Skip to content

Fix $goto target position - #306

Merged
tobil4sk merged 5 commits into
HaxeFoundation:masterfrom
tobil4sk:fix/goto
Sep 2, 2026
Merged

Fix $goto target position#306
tobil4sk merged 5 commits into
HaxeFoundation:masterfrom
tobil4sk:fix/goto

Conversation

@tobil4sk

@tobil4sk tobil4sk commented Feb 16, 2025

Copy link
Copy Markdown
Member

Closes #184

The old code would use an absolute position for the genrated Jump, but jumps are meant to have relative positions.

This caused an out-of-bounds error when doing further processing:

| Jump n -> pop := (pos.[i+n] - pos.[i]); 23

Using the goto helper function here creates a Jump with a relative address instead.

neko/src/neko/Compile.nml

Lines 211 to 213 in 1eab131

function goto(ctx,p) {
write ctx Jump(p - pos ctx)
}

@tobil4sk
tobil4sk merged commit 4ff9ea7 into HaxeFoundation:master Sep 2, 2026
16 checks passed
@tobil4sk
tobil4sk deleted the fix/goto branch September 2, 2026 08:14
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.

Invalid_argument(Array.get) from nekoc

1 participant