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

Bump native recursion count early in call handling #2108

Merged
merged 3 commits into from
Jun 10, 2019

Conversation

svaarala
Copy link
Owner

If the native recursion depth is not bumped early in call handling, we may trigger a getter or a Proxy trap before we've increased the recursion depth leading to another native call. This process may continue unchecked by the native call limit in the worst case (such as #2032).

For similar reasons, ensure value stack space early in the call handling -- even before the target function is known and value stack is actually configured for the new function. This is not ideal because each call now involves two value stack resize checks, but if this isn't done, early recursion in call handling may consume the expected value stack reserve (which is the actually triggered effect in #2032).

Fixes #2032.

This avoids situations where call handling reads a property and triggers
a recursive call through a Proxy before the C call recursion depth is
increased.  This may then lead to unbounded C recursion without an
effective call stack limit.
@svaarala svaarala added this to the v2.4.0 milestone Jun 10, 2019
@svaarala svaarala merged commit ec6fa10 into master Jun 10, 2019
@svaarala svaarala deleted the fix-call-proxy-trap-gh2032 branch June 10, 2019 01:08
@svaarala
Copy link
Owner Author

This also fixes #2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant