HLIL can produce unsound control flow structuring in some conditions.
Consider this MLIL code:
orig_state_exec.zip
In MLIL everything looks correct:

Consider the case when 'i = 0the path meansiis assigned to5and then ultimately goes to instruction21`
Now in HLIL:

The control flow is a series of if statements rather than if-else statements. In the case of i == 0 it meets the first condition and sets i = 5 and then can also satisfy the second condition too incorrectly setting var_20 = 1
Special Thanks to: Zao Yang and Stefan Nagy for their research in Decompiler Fuzzing for reporting this issue.
HLIL can produce unsound control flow structuring in some conditions.
Consider this MLIL code:
orig_state_exec.zip
In MLIL everything looks correct:

Consider the case when 'i = 0
the path meansiis assigned to5and then ultimately goes to instruction21`Now in HLIL:

The control flow is a series of
ifstatements rather thanif-elsestatements. In the case ofi == 0it meets the first condition and setsi = 5and then can also satisfy the second condition too incorrectly settingvar_20 = 1Special Thanks to: Zao Yang and Stefan Nagy for their research in Decompiler Fuzzing for reporting this issue.