-
Notifications
You must be signed in to change notification settings - Fork 60
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
ON GOSUB may be slightly off. #38
Comments
I found the following article really interesting: It says the following about on..gosubs behaviour in this case:
Is this how it should handled here? I read that in some versions of BASIC it results in an error but in most versions it just gets skipped if it is out of bounds. |
My offhand reaction is that until we have a more unified place to put compat flags / modes of operation that we'd want to support the most permissive thing (fallthru) as working programs are unlikely to meaningfully rely on erroring in this case. But this might be a good place for a TODO: Make this behavior configurable once we have BASIC version flags. In terms of the return behavior, also note that:
Emits:
Where one might have expected:
|
Resolved in: Thanks pauwell! |
ON GOSUB unconditionally pushes a return address onto the stack, even when out of bounds.
Unsure if this matches canonical behavior.
We should confirm and add a test.
The text was updated successfully, but these errors were encountered: