darknesswind / NutCracker

fork from DamianXVI's squirrel decompiler
20 stars 9 forks source link

In some cases foreach loop decompilation is invalid #8

Closed Psimage closed 7 years ago

Psimage commented 7 years ago

image

Psimage commented 7 years ago

Shouldn't 'b' be only visible in foreach scope?

darknesswind commented 7 years ago

yes, but I don't have enough time work on this feature

Psimage commented 7 years ago

image

https://github.com/darknesswind/NutCracker/blob/45cadc1d3ac3c012b628a80ca16c1533c9794f5a/nutcracker/NutScript.cpp#L147-L165

In the BAD version there is no @ITERATOR@ special local variable generated. Compiled with sq 3.0.4. Maybe it's a bug in the compiler, since latest 3.0.x version is 3.0.7

Psimage commented 7 years ago

Same result with v3.0.7

Psimage commented 7 years ago

I fixed this. Will push soon.