Currently, you can --disassemble and the first line should be .version 5.1. Probably at some point I will add comments to the decompilation with certain metadata.
Gotos from decompiling versions before 5.2 happen as a fallback when working with debug-stripped code. As unluac doesn't properly support these yet, its poor understanding of which registers are temporary can lead to situations where decompiling without gotos is impossible -- gotos are used as an alternative to failure (since it might still be useful to read even if it can't be re-compiled as is).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there.
When I decompile a file that is lua 5.1 it ends up with goto functions which came in 5.2 - How can I tell the version the decompiled code should have?
Currently, you can
--disassembleand the first line should be.version 5.1. Probably at some point I will add comments to the decompilation with certain metadata.Gotos from decompiling versions before 5.2 happen as a fallback when working with debug-stripped code. As unluac doesn't properly support these yet, its poor understanding of which registers are temporary can lead to situations where decompiling without gotos is impossible -- gotos are used as an alternative to failure (since it might still be useful to read even if it can't be re-compiled as is).