Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable LOADNIL code generation optimisation #523

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tul
Copy link
Contributor

@tul tul commented Jan 10, 2025

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

The `AddLoadNil` method 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.
@coveralls
Copy link

Coverage Status

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LOADNIL merging optimisation (still) produces invalid code
2 participants