mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-19 18:00:23 +08:00
assemble: print a warning on a forward reference in RESx
Print a warning on a forward reference in RESx. This really should have been a critical expression, and a forward reference should have been an error, but it wasn't implemented that way and as such we can't just randomly break people's code, even if it is dangerous.
This commit is contained in:
parent
976ba73062
commit
c5d40b3576
@ -1178,6 +1178,9 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
|
||||
if (ins->oprs[0].segment != NO_SEG)
|
||||
nasm_error(ERR_NONFATAL, "attempt to reserve non-constant"
|
||||
" quantity of BSS space");
|
||||
else if (ins->oprs[0].opflags & OPFLAG_FORWARD)
|
||||
nasm_error(ERR_WARNING | ERR_PASS1,
|
||||
"forward reference in RESx can result in unpredictable results");
|
||||
else
|
||||
length += ins->oprs[0].offset;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user