Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect/no parentheses added to math expressions to keep order of operations correct #34

Open
Gorfiend opened this issue Sep 20, 2024 · 0 comments

Comments

@Gorfiend
Copy link

Input source:

Event OnInit()
  int a = 1 + 2 - 3 + 4
  int b = (1 + 2) - (3 + 4)
  int c = a - (b + 1)
  int d = 1 - (2 + ((3 * 4) / 5))
  int e = 1 - 2 + ((3 * 4) / 5)
EndEvent

Decompiled source:

Event OnInit()
  Int a = 1 + 2 - 3 + 4 ; #DEBUG_LINE_NO:4
  Int b = 1 + 2 - 3 + 4 ; #DEBUG_LINE_NO:5
  Int c = a - b + 1 ; #DEBUG_LINE_NO:6
  Int d = 1 - 2 + 3 * 4 / 5 ; #DEBUG_LINE_NO:7
  Int e = 1 - 2 + 3 * 4 / 5 ; #DEBUG_LINE_NO:8
EndEvent

The decompiler doesn't seem to add any parentheses to keep the order of operations, thus changing the meaning of many math expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant