Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Jan 30, 2025

We previously asserted that the end of a nested expression is the same
when we parse it with a null context just to find its children and when
we parse it for real. It turns out that it is possible for the two end
positions to be different when the instruction is invalid in a way that
only the real parse catches. Return a normal error instead of asserting
because it is possible for invalid input to trigger this condition.

Fixes #7251.

We previously asserted that the end of a nested expression is the same
when we parse it with a null context just to find its children and when
we parse it for real. It turns out that it is possible for the two end
positions to be different when the instruction is invalid in a way that
only the real parse catches. Return a normal error instead of asserting
because it is possible for invalid input to trigger this condition.

Fixes #7251.
@tlively tlively requested a review from kripken January 30, 2025 02:29
@tlively tlively enabled auto-merge (squash) January 30, 2025 06:15
if (ctx.in.getPos() != *info.end) {
return ctx.in.err("expected end of instruction");
}
assert(ctx.in.getPos() == *info.end && "expected end of instruction");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove this assertion now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

@tlively tlively merged commit 92ad959 into main Jan 30, 2025
14 checks passed
@tlively tlively deleted the fix-7251 branch January 30, 2025 16:34
tlively added a commit that referenced this pull request Jan 30, 2025
This should have been removed in #7252.
tlively added a commit that referenced this pull request Jan 30, 2025
This should have been removed in #7252.
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.

"expected end of instruction" text parse error on invalid memory index

3 participants