uxmal / reko

Reko is a binary decompiler.
https://uxmal.github.io/reko
GNU General Public License v2.0
2.09k stars 250 forks source link

Reko fails to recover floating-point code #1339

Closed uxmal closed 2 months ago

uxmal commented 2 months ago

(See #1337 opened by @yangzao for the binary in question, program 2) Original code:

((int)((((double)(i_l)) -((double)(1)))))

Decompiled code:

(int32) ((real64) 1e-45F - 1.0)

(double)(i_1) (i_l equals to 1) is recovered as 1e-45F.

Bonus issue: Reko's high-level code generation pass is leaving *s (signed multiplication) operations in the generated C code.