3 ms·
That's awesome! That's exactly how modern decompilers deal with a special type of goto occurrence. They reduce gotos (or completely eliminate them) by introduci
by mahaloz 3y ago
That's awesome! That's exactly how modern decompilers deal with a special type of goto occurrence. They reduce gotos (or completely eliminate them) by introducing a `while(true)` loop, followed by corresponding `continue` and `breaks`... we all, of course, know that `while(true)` did not exist in the source, but it's a nice hack!
We even do this in the angr decompiler, found here: https://github.com/angr/angr/blob/8e48d001e18a913ecd4ed2e9955137c39d36c959/angr/analyses/decompiler/structuring/phoenix.py#L220C14-L220C14 https://github.com/angr/angr/blob/8e48d001e18a913ecd4ed2e995...