summaryrefslogtreecommitdiff
path: root/dynasm/dasm_x86.h
diff options
context:
space:
mode:
authorMike Pall <mike>2013-03-17 14:20:40 +0100
committerMike Pall <mike>2013-03-17 14:20:40 +0100
commitd147eedac963f6dfc757d269c180985fd9c0c1e7 (patch)
tree63f3219e6afa13a72b815560ee90f5ce4d8e55f8 /dynasm/dasm_x86.h
parenteea48c8b263f4fb294200f394764a6eba1de877a (diff)
downloadluajit2-d147eedac963f6dfc757d269c180985fd9c0c1e7.tar.gz
DynASM: Improve validation of local backwards relocations.
Diffstat (limited to 'dynasm/dasm_x86.h')
-rw-r--r--dynasm/dasm_x86.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/dynasm/dasm_x86.h b/dynasm/dasm_x86.h
index eb2bc768..c91bfdd5 100644
--- a/dynasm/dasm_x86.h
+++ b/dynasm/dasm_x86.h
@@ -213,7 +213,8 @@ void dasm_put(Dst_DECL, int start, ...)
case DASM_REL_LG:
case DASM_IMM_LG:
n = *p++; pl = D->lglabels + n;
- if (n <= 246) { CKPL(lg, LG); goto putrel; } /* Bkwd rel or global. */
+ /* Bkwd rel or global. */
+ if (n <= 246) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; }
pl -= 246; n = *pl;
if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */
goto linkrel;