Oops I forgot to devlog for a while!
I found an annoying bug in the SSA optimisation pass where the type stack was discarded when an if/else block was encountered. This makes sense in normal execution, (because if/elses only occur when the stack is empty), but some list reporters use if/elses internally (because their output depends on the input moreso than usual - they need to check for inputs like “random” which has special behaviour). So, I rewrote how stacks are handled in the SSA; now, rather than at each node in the graph storing the type stack and also which variables to pop into from the stack, each node stores a single instruction: push something to the stack, or pop from the stack (or drop from the stack). This results in way more nodes, but it’s much simpler and doesn’t have the same problem as before. Success!
I’ve also implemented a couple more blocks - data_listcontainsitem, pen_changePenColorParamBy, and motion_movesteps.
Today’s attachment: a stack overflow when there are too many SSA nodes. Woops! Maybe time to turn some recursive calls into loops.
Log in to leave a comment