gopher-lua icon indicating copy to clipboard operation
gopher-lua copied to clipboard

disable LOADNIL code generation optimisation

Open tul opened this issue 1 year ago • 1 comments

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

tul avatar Jan 10 '25 12:01 tul

Coverage Status

coverage: 89.603% (-0.02%) from 89.623% when pulling b3dcd3f01f1dcf52d0303e9431bbbd51aa5772b6 on tul:disable_loadnil_merge into ccacf662c9d24821ea6cb1abaa515cc3b6aad7c6 on yuin:master.

coveralls avatar Jan 10 '25 13:01 coveralls