EdouardBERGE / rasm

RASM powerful Z80 assembler
129 stars 16 forks source link

Using {SIZEOF} with an unexisting structure name silently resolves to 0xFF #36

Closed anrikun closed 1 month ago

anrikun commented 1 month ago

In my code, I had: add {sizeof}MyStruct When debugging my code, I noticed that I had renamed the MyStruct structure in the meantime forgetting to update this line. But RASM did not throw any error, and silently resolved {sizeof}MyStruct as 0xFF

I think this should throw an error.

EdouardBERGE commented 1 month ago

do you have a concrete example? there is a check and an error message in that case

unlabel
ld a,{sizeof}unlabel

[nostruct.asm:4] cannot SIZEOF unknown structure [UNLABEL]!

anrikun commented 1 month ago

Here's a sample to reproduce the issue. main.asm.txt

Compiled running: "..\asm\rasm.exe" ./src/main.asm -o test3 -sw -sb -void

Compiled with: RASM v2.2.5 (build xx/06/2024) - Consolidation

Output: Pre-processing [./src/main.asm] Assembling -1.00 Write snapshot v3 file test3.sna WriteSNA bank 0,1,2,3 packed Total 4 banks (64K) Write symbol file test3.sym

debugger

EdouardBERGE commented 1 month ago

Aaaaaaaaaaaaaaaaaahhh! nice example, will fix it quickly ;) THANKS

EdouardBERGE commented 1 month ago

commited https://github.com/EdouardBERGE/rasm/commit/e7a8a7da25f38ec85039792d3cba0b5940979bba

anrikun commented 1 month ago

Thank you for the fix Edouard and also for the quick release!