summaryrefslogtreecommitdiff
path: root/src/lj_mcode.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-05-09 18:16:39 +0200
committerMike Pall <mike>2011-05-09 20:46:58 +0200
commit67d3ac9b19caba68069e83d1e3e9de14994d66cd (patch)
treead1b075e255dcaabebfea8b6e5e70aa4a3eb63d2 /src/lj_mcode.c
parent28e87d33e931661e8118a25b293213938a9e0af4 (diff)
downloadluajit-67d3ac9b19caba68069e83d1e3e9de14994d66cd.tar.gz
luajit-67d3ac9b19caba68069e83d1e3e9de14994d66cd.tar.bz2
luajit-67d3ac9b19caba68069e83d1e3e9de14994d66cd.zip
Fix some portability issues with the JIT compiler.
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 }