DynASM: Improve validation of local backwards relocations.

This commit is contained in:
Mike Pall
2013-03-17 14:20:40 +01:00
parent eea48c8b26
commit d147eedac9
4 changed files with 8 additions and 4 deletions

View File

@@ -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;