ljd icon indicating copy to clipboard operation
ljd copied to clipboard

LuaJIT Raw-Bytecode Decompiler (LJD)

Results 8 ljd issues
Sort by recently updated
recently updated
newest added

Solves decompilaton of ```lua function test() print("Header") do return end print("Footer") end ``` into ```lua function test() print("Header") return --invalid mid function return, won't compile again print("Footer") end ``` This...

https://github.com/Aussiemon/ljd/blame/2ed0381b2e563531b0fe8de0a574cea8e6a04478/ljd/ast/helpers.py#L92 why the check for function depth and up value needed? ```lua local T = { a = 1, } T.self_val = T ``` would be squashed to ```lua local...

Lua tables can have an empty trailing comma. Consider "without" vs "with" trailing comma: ```lua mytable = { 1, 2 } ``` ```lua mytable = { 1, 2, } ```...

Original Lua string constants may contain "unusual" characters, and when such a string is encountered, ljd stops writing more Lua. I am not very familiar with the differences between string...

Following code fails for some files (`state.debuginfo.addr_to_line_map` is empty, so index our of bounds exception is thrown): https://github.com/Aussiemon/ljd/blob/2ed0381b2e563531b0fe8de0a574cea8e6a04478/ljd/ast/builder.py#L1265 My workaround was ```py line_mapping = -1 if preceding_index >= 0 and...

The devel branch of znix's fork contains important fixes, you should probably merge it too. (https://gitlab.com/znixian/luajit-decompiler/-/tree/devel)

Problematic place in the code: https://github.com/Aussiemon/ljd/blob/1c4e1a2a9bd8c11aea045045fd955b5ea1c8a6c5/ljd/ast/slotworks.py#L252 Test code: ``` _remove_invalid_references() if (len(info.references) != 2): for ref in info.references: print("ID:", ref.identifier.id) assert len(info.references) == 2 ``` Output: ``` ID: 861 ID:...

**Hello,I tried to decompile luajit, but the following error occurred:** Traceback (most recent call last): File "main.py", line 468, in retval = main_obj.main() File "main.py", line 299, in main ast...