x87 / scout

Scout Decompiler
https://scout.sannybuilder.com/
Other
9 stars 0 forks source link

Crash on ASUSB3 mission (GTA 3) #22

Closed x87 closed 1 year ago

x87 commented 4 years ago

Error: Internal error: node not found at Function.error (\scout\build\scout.js:377:16) at Object.replaceNodes (\scout\build\scout.js:2535:29) at replaceIf (\scout\build\scout.js:2792:30) at structure (\scout\build\scout.js:2803:5)

x87 commented 4 years ago

Crash happens due to ambiguity in control flow caused by usage of the goto instruction:

while
   if cond then
     goto @exit
   end
end 
:exit

with some extra conditions goto @exit is considered as part of if..then..else construct, not if..then as it should be.

x87 commented 4 years ago

related to #13

x87 commented 4 years ago

smallest repro:

0000:
while true
    if 0@ > 0
    then
       break 
    end
    if 0@ > 1
    then
       jump @exit
    end
end

while true
    if 0@ > 0
    then
       break 
    end
    if 0@ > 1
    then
       jump @exit
    end
end

:exit
end_thread   
x87 commented 4 years ago

Until somehow resolved the decompiler fallbacks to the raw output if the structuring failed.