-
Notifications
You must be signed in to change notification settings - Fork 13
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
Exception handler stack is not popped when handler returns a value #7
Comments
I've been able to resolve this by removing the call to pop handlers from Line 1259 in 9c9c5d1
And adding it above this line in Line 1207 in 9c9c5d1
I'm not sure if this a proper fix and would appreciate guidance. |
Wrote new tests to compare NEWT/0 generated bytecode with NewtonOS built-in compiler. There are differences that may account for what you observed, fixing them one by one. However, the proposed change doesn't fix it. |
Exceptions are now propagated through saved vm environments (gnue#8). Pop-handler and pop are generated in the right sequence, following NewtonOS compiler. Fix si_set_lex_scope for native functions. Add unit tests for various cases. Add BinEqual function for tests.
Exceptions are now propagated through saved vm environments (gnue#8). Pop-handler and pop are generated in the right sequence, following NewtonOS compiler. Fix si_set_lex_scope for native functions. Add unit tests for various cases. Add BinEqual function for tests.
Exceptions are now propagated through saved vm environments (gnue#8). Pop-handler and pop are generated in the right sequence, following NewtonOS compiler. Fix si_set_lex_scope for native functions. Add unit tests for various cases. Add BinEqual function for tests.
It appears that the exception handler stack is not popped when a handler is invoked that returns a value. This would seem to be because the
kNBCPopHandlers
is generated after the branch to the handler, and thus is not invoked due to the return statement.This causes subsequent exceptions to not be handled properly.
The following NewtonScript code demonstrates the problem:
When ran under NEWT/0, the output is:
(Note: Attempt 2 is never logged)
Under WallyScript/NewtonScript 1.x:
The text was updated successfully, but these errors were encountered: