summaryrefslogtreecommitdiff
path: root/src/lj_mcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_mcode.c')
-rw-r--r--src/lj_mcode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_mcode.c b/src/lj_mcode.c
index 104e4925..b3ce1f7f 100644
--- a/src/lj_mcode.c
+++ b/src/lj_mcode.c
@@ -274,7 +274,7 @@ MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish)
274 } else { 274 } else {
275 MCode *mc = J->mcarea; 275 MCode *mc = J->mcarea;
276 /* Try current area first to use the protection cache. */ 276 /* Try current area first to use the protection cache. */
277 if (ptr >= mc && ptr < mc + J->szmcarea) { 277 if (ptr >= mc && ptr < (MCode *)((char *)mc + J->szmcarea)) {
278 mcode_protect(J, MCPROT_GEN); 278 mcode_protect(J, MCPROT_GEN);
279 return mc; 279 return mc;
280 } 280 }
@@ -282,7 +282,7 @@ MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish)
282 for (;;) { 282 for (;;) {
283 mc = ((MCLink *)mc)->next; 283 mc = ((MCLink *)mc)->next;
284 lua_assert(mc != NULL); 284 lua_assert(mc != NULL);
285 if (ptr >= mc && ptr < mc + ((MCLink *)mc)->size) { 285 if (ptr >= mc && ptr < (MCode *)((char *)mc + ((MCLink *)mc)->size)) {
286 mcode_setprot(mc, ((MCLink *)mc)->size, MCPROT_GEN); 286 mcode_setprot(mc, ((MCLink *)mc)->size, MCPROT_GEN);
287 return mc; 287 return mc;
288 } 288 }