[BUG] DivExpression problem on division by 0 #65
Labels
bug
Something isn't working
waiting for release
The issue has been fixed, but the fix is not included in the current release.
Describe the bug
The DivExpression in ast.lua has a
simplify
argument which will perform the division and store the result if both left and right-hand side of the expression is a constant. This works great in all cases except when dividing by 0.The above three expressions return constants inf and nan of type number. The problem when simplifying this is that the resulting string will become:
Expected behavior
The DivExpression should not simplify the expression when the right hand side is 0.
To Reproduce
Steps to reproduce the behavior:
divexpression.lua
containingprint(-1/0)
lua cli.lua --preset Weak divexpression.lua
Observe
divexpression.obfuscated.lua
The text was updated successfully, but these errors were encountered: