dschmenk / PLASMA

Proto Language AsSeMbler for All (formerly Apple)
MIT License
189 stars 26 forks source link

Possible bug in lambda function LEAVE #31

Closed ZornsLemma closed 6 years ago

ZornsLemma commented 6 years ago

I haven't tried to trigger this bug yet, but just looking at codegen.c's emit_lambdafunc(), it seems to emit an incorrect LEAVE opcode with no argument:

    if (cparams)
        printf("\t%s\t$5A\t\t\t; LEAVE\n", DB);

Apologies if this isn't a real bug, but I thought I should mention it before I forget...

Cheers.

Steve

dschmenk commented 6 years ago

Thanks Steve! Great catch. I actually got it right in the self-hosted compiler, but missed it in the cross compiler. Odd that the portable VM didn't catch it. I'll have to update its checks.

dschmenk commented 6 years ago

Steve- I should mention that there has been a lot of discussion on VM improvements here:

https://groups.google.com/forum/?fromgroups#!topic/comp.sys.apple2.programmer/aFY8pKRSaIQ

Definitely worth reviewing.

Dave...