RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
195 stars 42 forks source link

reject sizeof(struct that isn't declared yet) #301

Open Alcaro opened 5 months ago

Alcaro commented 5 months ago
[21:48:33]  <Sir Walrus> okay I'ma turn that into a phantom or moving label error before 2200
...
[21:49:19]  <Sir Walrus> well that was easy
[21:49:20]  <Sir Walrus> !rb as2
!x = 3
if sizeof(SomeStruct) == 2
    !x = 4
else
    !x = 2
endif

struct SomeStruct
    .item: skip !x
    .label2:
endstruct
[21:49:20]  <randombot999#8226> Errors occurred while assembling.
<input>:11: error: (Einternal_error): An internal error occured (moving label). This is a bug in Asar, please report it at https://github.com/RPGHacker/asar/issues, along with a patch that reproduces it if possible.
    in block: [.label2:]
[21:49:58]  <Sir Walrus> and here's the other
[21:49:59]  <Sir Walrus> !rb as2
!x = 3
if sizeof(SomeStruct) == 2
    !x = 4
else
    !x = 2
    walrus2.0
endif

struct SomeStruct
    .item: skip !x
endstruct
[21:50:00]  <randombot999#8226> Errors occurred while assembling.
: error: (Einternal_error): An internal error occured (phantom error). This is a bug in Asar, please report it at https://github.com/RPGHacker/asar/issues, along with a patch that reproduces it if possible.