udem-dlteam / pnut

🥜 A Self-Compiling C Transpiler Targeting Human-Readable POSIX Shell
https://pnut.sh
BSD 2-Clause "Simplified" License
425 stars 14 forks source link

Fix shell pre/post increment not appearing #37

Closed laurenthuberdeau closed 5 months ago

laurenthuberdeau commented 5 months ago

Tried to use ++ and -- in shell and it wasn't working. It looks like we forgot to set contains_side_effects = true for these operators.

This bug revealed another bug where the a basic block with an arithmetic statement without side effect can cause the block to be empty, which is a syntax error.