Skip to content
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

[cppia] Respect jit exceptions in interp mode #1188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented Feb 2, 2025

When running in interp mode, native c++ exception handling is used, but when running jit mode, jumps are used along with ctx->exception.

This means that an exception thrown from jit mode is not respected in interp mode. This can cause problems with local functions (which are interpreted even in jit mode). When a local function calls a compiled function that throws an exception, the exception is ignored until we return back into a compiled function.

This patch fixes the problem by checking ctx->exception when running in interp mode, to make sure that no exception has been thrown from a jit compiled function.

This fixes #876.

When running in interp mode, native c++ exception handling is used, but
when running jit mode, jumps are used along with ctx->exception.

This means that an exception thrown from jit mode is not respected in
interp mode. This can cause problems with local functions (which are
interpreted even in jit mode). When a local function calls a compiled
function that throws an exception, the exception is ignored until we
return back into a compiled function.

This patch fixes the problem by checking ctx->exception when running in
interp mode, to make sure that no exception has been thrown from a jit
compiled function.
@tobil4sk tobil4sk force-pushed the fix/cppia-jit-local-func-exceptions branch from ebfb2c3 to 18af688 Compare February 3, 2025 02:05
@skial skial mentioned this pull request Feb 3, 2025
1 task
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.

Cppia - throw inside while
1 participant