Skip to content

Cppia - throw inside while #876

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

Closed
hughsando opened this issue Dec 24, 2019 · 2 comments · Fixed by #1188
Closed

Cppia - throw inside while #876

hughsando opened this issue Dec 24, 2019 · 2 comments · Fixed by #1188

Comments

@hughsando
Copy link
Member

HaxeFoundation/haxe#8915

@tobil4sk
Copy link
Member

tobil4sk commented Jan 31, 2025

This seems to no longer reproduce in interp mode, but still does with jit. Here is a more stripped down sample, it is possible to demonstrate the issue without the while loop:

function other() {
	throw new haxe.Exception("hi");
}

function main() {
	function local() {
		other();
		trace("Continued past exception!");
	};

	local();
}

@tobil4sk
Copy link
Member

tobil4sk commented Feb 2, 2025

I've tried to investigate this issue, and it looks like the issue might be a result of local functions not being jit compiled. This means that the exception is thrown from jit -> interp -> jit, and it seems like exception handling wasn't designed in a way that considers that case. In interp mode, ctx->exception is never checked so it continues as normal until the exception is picked up again once we go back into jit world.

It seems like either of these need to be done:

  1. local functions should be jit compiled, and we should check that everything is always jit compiled.
    or
  2. Interp mode should consider exceptions thrown from jit mode.

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 a pull request may close this issue.

2 participants