Merge pull request #604 from NieDzejkob/narg-overwrite

Don't overwrite symbol when it's not allowed
This commit is contained in:
Eldred Habert
2020-10-13 10:47:57 +02:00
committed by GitHub
4 changed files with 8 additions and 0 deletions

View File

@@ -409,6 +409,7 @@ struct Symbol *sym_AddSet(char const *symName, int32_t value)
symName, sym->type == SYM_LABEL ? "label" : "constant");
dumpFilename(sym);
putc('\n', stderr);
return sym;
} else {
/* TODO: can the scope be incorrect when taking over refs? */
updateSymbolFilename(sym);

View File

@@ -0,0 +1,2 @@
_NARG = 0
_NARG = 0

View File

@@ -0,0 +1,5 @@
ERROR: narg-overwrite.asm(1):
'_NARG' already defined as constant at <builtin>
ERROR: narg-overwrite.asm(2):
'_NARG' already defined as constant at <builtin>
error: Assembly aborted (2 errors)!

View File