wiz-lang / wiz

A high-level assembly language for writing homebrew software and games on retro console platforms.
http://wiz-lang.org/
Other
409 stars 40 forks source link

segmentation fault with compile_if and an inline function let argument #143

Open undisbeliever opened 2 years ago

undisbeliever commented 2 years ago

wiz crashes with a segmentation fault if I use a compile_if attribute that references an inline func's let argument.


(6502 platform)

bank code     @ 0x8000  : [constdata; 0x8000];

in code {

inline func f(let v : u8) {
    #[compile_if(v != 0)] {
        a += v;
    }
}

func test() {
    f(12);
}

}


wiz output:

> ~/repo/snes/unnamed-snes-game/wiz/bin/wiz --system 6502 -o /tmp/wiz.bin bug.wiz 
* wiz: version 0.1.2 (alpha)
>> Parsing...
>> Compiling...
zsh: segmentation fault (core dumped)  ~/repo/snes/unnamed-snes-game/wiz/bin/wiz --system 6502 -o /tmp/wiz.bin