Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Nested While in If/Else jumps to wrong address #125

Open
PeterTillema opened this issue Apr 10, 2019 · 1 comment
Open

Nested While in If/Else jumps to wrong address #125

PeterTillema opened this issue Apr 10, 2019 · 1 comment
Labels

Comments

@PeterTillema
Copy link
Owner

If <condition>
	<small code: < 128 bytes>
Else
	While <condition>
		<large code: > 127 bytes>
	End
End

Result: the While <condition> injects a JP to its End, but the If <condition> uses a JR to its Else part, causing to move the entire While code 2 bytes up, which clearly makes the JP invalid.

Thanks @TheLastMillennial for finding the bug!

@TheLastMillennial
Copy link
Collaborator

I'd like to add that this did not apply just to While loops but to anything that was within the Else. The only solution is to remove the Else.

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

No branches or pull requests

2 participants