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

Truncate environment stack on non-caught native error #3331

Merged
merged 2 commits into from
Oct 1, 2023

Conversation

HalidOdat
Copy link
Member

When an native error is thrown and not caught it only truncates the value stack, the environment stack is not changed this causes panics if we run code than access the environment.

For example

with (new Proxy({}, {has: p => false})) {a}

Running this code twice causes a panic (boa file.js file.js).

panicked at 'environment must be declarative', boa_engine/src/vm/opcode/define/mod.rs:114:33

@HalidOdat HalidOdat added bug Something isn't working execution Issues or PRs related to code execution labels Oct 1, 2023
@HalidOdat HalidOdat added this to the v0.18.0 milestone Oct 1, 2023
@github-actions
Copy link

github-actions bot commented Oct 1, 2023

Test262 conformance changes

Test result main count PR count difference
Total 95,574 95,574 0
Passed 75,201 75,201 0
Ignored 19,482 19,482 0
Failed 891 891 0
Panics 0 0 0
Conformance 78.68% 78.68% 0.00%

@codecov
Copy link

codecov bot commented Oct 1, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (ca37aa2) 49.34% compared to head (25ec2dc) 49.41%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3331      +/-   ##
==========================================
+ Coverage   49.34%   49.41%   +0.07%     
==========================================
  Files         445      445              
  Lines       43892    43891       -1     
==========================================
+ Hits        21657    21690      +33     
+ Misses      22235    22201      -34     
Files Coverage Δ
boa_engine/src/vm/code_block.rs 52.06% <100.00%> (-0.23%) ⬇️
boa_engine/src/vm/mod.rs 61.42% <100.00%> (+1.72%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@nekevss nekevss added this pull request to the merge queue Oct 1, 2023
Merged via the queue into main with commit e54609e Oct 1, 2023
10 checks passed
@HalidOdat HalidOdat deleted the fix/truncate-environment-on-non-caught-native-error branch October 1, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants