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)
downloadluajit2-67d3ac9b19caba68069e83d1e3e9de14994d66cd.tar.gz
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)
} else {
MCode *mc = J->mcarea;
/* Try current area first to use the protection cache. */
- if (ptr >= mc && ptr < mc + J->szmcarea) {
+ if (ptr >= mc && ptr < (MCode *)((char *)mc + J->szmcarea)) {
mcode_protect(J, MCPROT_GEN);
return mc;
}
@@ -282,7 +282,7 @@ MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish)
for (;;) {
mc = ((MCLink *)mc)->next;
lua_assert(mc != NULL);
- if (ptr >= mc && ptr < mc + ((MCLink *)mc)->size) {
+ if (ptr >= mc && ptr < (MCode *)((char *)mc + ((MCLink *)mc)->size)) {
mcode_setprot(mc, ((MCLink *)mc)->size, MCPROT_GEN);
return mc;
}