Skip to content

Prevent @:bypassAccessor leaking after break or return - #34

Open
hackx2 wants to merge 1 commit into
CodenameCrew:codename-devfrom
hackx2:bypassAccessorLeak
Open

hackx2 wants to merge 1 commit into
CodenameCrew:codename-devfrom
hackx2:bypassAccessorLeak

Conversation

@hackx2

@hackx2 hackx2 commented Nov 19, 2026 •

Copy link
Copy Markdown

Before this PR, running the following caused property accessors to be bypassed even after the @:bypassAccessor block had already exited.

function a() {
	@:bypassAccessor {
		return 1;
	}
}

a();
var b = new BypassAccessor();
// variable with a getter func that increments
// amt every time its called
b.a = "c"; // bypassed here
trace(b.amt); // should return 1, but returns 0

This happens because the interpreter uses throws as stop signals. a returns 1; SReturn is thrown, and isBypassAccessor = oldAccessor gets skipped completely.

This fix just wraps the eval in a try/catch block, restoresisBypassAccessor, and rethrows.


+ @:bypassAccessor tests

I'll go more in-depth in my pr.
+ bypass accessor tests
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.

1 participant