diff options
author | Mike Pall <mike> | 2023-09-09 17:44:54 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2023-09-09 17:44:54 +0200 |
commit | 43eff4aad45e03ac7e415cd20b97161897b14756 (patch) | |
tree | eb4d1300def87e33a117bc7305cf0d2e786f072e | |
parent | 7f9907b4ed0870ba64342bcc4b26cff0a94540da (diff) | |
download | luajit-43eff4aad45e03ac7e415cd20b97161897b14756.tar.gz luajit-43eff4aad45e03ac7e415cd20b97161897b14756.tar.bz2 luajit-43eff4aad45e03ac7e415cd20b97161897b14756.zip |
Fix mcode limit check for non-x86 archs.
Thanks to Peter Cawley.
-rw-r--r-- | src/lj_mcode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_mcode.c b/src/lj_mcode.c index 7013cd7d..4a1ba4aa 100644 --- a/src/lj_mcode.c +++ b/src/lj_mcode.c | |||
@@ -371,7 +371,7 @@ void lj_mcode_limiterr(jit_State *J, size_t need) | |||
371 | sizemcode = (size_t)J->param[JIT_P_sizemcode] << 10; | 371 | sizemcode = (size_t)J->param[JIT_P_sizemcode] << 10; |
372 | sizemcode = (sizemcode + LJ_PAGESIZE-1) & ~(size_t)(LJ_PAGESIZE - 1); | 372 | sizemcode = (sizemcode + LJ_PAGESIZE-1) & ~(size_t)(LJ_PAGESIZE - 1); |
373 | maxmcode = (size_t)J->param[JIT_P_maxmcode] << 10; | 373 | maxmcode = (size_t)J->param[JIT_P_maxmcode] << 10; |
374 | if ((size_t)need > sizemcode) | 374 | if (need * sizeof(MCode) > sizemcode) |
375 | lj_trace_err(J, LJ_TRERR_MCODEOV); /* Too long for any area. */ | 375 | lj_trace_err(J, LJ_TRERR_MCODEOV); /* Too long for any area. */ |
376 | if (J->szallmcarea + sizemcode > maxmcode) | 376 | if (J->szallmcarea + sizemcode > maxmcode) |
377 | lj_trace_err(J, LJ_TRERR_MCODEAL); | 377 | lj_trace_err(J, LJ_TRERR_MCODEAL); |