gopher-lua
gopher-lua copied to clipboard
disable LOADNIL code generation optimisation
The AddLoadNil method is used to merge multiple consecutive LOADNIL instructions of consecutive registers into a single LOADNIL instruction, but it caused issues when the merged instructions were JMP targets, and so generated invalid code; so the merging functionality has been removed.
It is safe to merge the LOADNIL instructions under certain conditions, but additional logic / complexity would be needed to determine this, hence simply disabling merging for now.
Fixes #522