nasm/asm
H. Peter Anvin (Intel) 6f830c1c74 labels: handle the sequence EXTERN, GLOBAL, defined
The sequence EXTERN, GLOBAL, definition would fail, because the EXTERN
would create a pseudo-segment and consider it a definition, whereas
GLOBAL would set change it to a global definition, but leaving the
definition existing, which is not the normal case for a GLOBAL symbol
(define_label would not be called.)

Therefore, explicitly "undefine" the symbol by setting defn.defined to
0, as it would be after a GLOBAL statement, as as it is when an EXTERN
statement is followed by a definition (causing it to be implicitly
promoted to GLOBAL.)

Reported-by: E. C. Masloch <ecm-pushbx@github.com>
Reported-by: <roel-z@github.com>
Fixes: https://github.com/netwide-assembler/nasm/issues/224
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2026-06-11 15:08:27 -07:00
..
asmutil.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
assemble.c asm/assemble.c: remove unused variable this_good 2026-06-04 10:51:49 -07:00
assemble.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
directiv.c fix [warning push] causing "unknown warning name" 2025-11-04 10:23:54 -08:00
directiv.dat directives: correctly handle quoted strings in directives 2025-10-10 10:41:09 -07:00
error.c error: factor out error functions into separate files 2025-11-07 14:42:33 -08:00
eval.c fix memory leak in eval_strfunc 2025-10-06 14:50:40 -07:00
eval.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
exprdump.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
exprlib.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
floats.c Warnings: disaggregate from source and tidy up documentation 2025-10-04 13:46:39 -07:00
floats.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
getbool.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
labels.c labels: handle the sequence EXTERN, GLOBAL, defined 2026-06-11 15:08:27 -07:00
listing.c listing: move LIST_* enums to listing.h 2026-03-04 14:14:02 -08:00
listing.h listing: move LIST_* enums to listing.h 2026-03-04 14:14:02 -08:00
nasm.c nasm.c: response file (-@) option parsing UAF affecting debug format selection (-F / -g) 2026-06-07 20:21:09 -07:00
parser.c Revert "parser: fix invalid segment override on EQU FAR pointers" 2026-06-07 20:54:47 -07:00
parser.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
pptok.dat treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
pptok.pl treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
pragma.c labels: make the prefix/suffix options and pragmas consistent 2025-10-07 18:46:39 -07:00
preproc.c preproc: ensure forward process in %clear loop 2026-06-11 14:40:01 -07:00
preproc.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
quote.c Add \^ escape sequences for Ctrl characters 2026-04-09 18:08:21 -07:00
quote.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
rdstrnum.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
segalloc.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
srcfile.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
srcfile.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
stdscan.c Warnings: disaggregate from source and tidy up documentation 2025-10-04 13:46:39 -07:00
stdscan.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
strfunc.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
tokens.dat treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
tokhash.pl treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
uncompress.c zlib: pass 15 not 0 to inflateInit2() 2025-11-04 00:38:17 -08:00
warnings.c Make: handle warning files while building in a directory 2023-01-17 13:05:55 -08:00
warnings.dat preproc: warn if the user tries to use %rmacro 2026-06-11 14:29:41 -07:00
warnings.pl error: factor out error functions into separate files 2025-11-07 14:42:33 -08:00