asar
asar copied to clipboard
`thisline` is off by 1 in macros
asar 1.90
macro Foo()
; Filler
error "foo"
endmacro
%Foo()
This produces foo.asm:4 (called from foo.asm:8): error: (Eerror_command): error command: foo. The error should be reported to originate from foo.asm:5.
The off-by-one is in the linenum argument provided to assembleline() inside callmacro(); thisline is set almost at the start of assembleline(). A few lines before that call, thisline is also set, but with the correct value. I'll note that, while it may seem like this setting of thisline before the assembleline() call is redundant as it's re-set so soon after, the recurseblock constructor may throw an error at the actual start of assembleline(), so setting thisline before that might be correct too; I haven't looked into this logic, but I figured I'd point it out in case the one fixing this misses this hidden side-effect and wants to account for it.