Skip to content

[Merged by Bors] - Fix incorrect LoopContinue instruction in while-do loops - #2866

Closed
HalidOdat wants to merge 1 commit into
mainfrom
fix/do-while-environment
Closed

HalidOdat wants to merge 1 commit into
mainfrom
fix/do-while-environment

Conversation

@HalidOdat

@HalidOdat HalidOdat commented Apr 24, 2023 •

Copy link
Copy Markdown
Member

While working on #2857 I discovered that while generating the bytecode for do-while loops we were emitting an orphan LoopContinue that is never executed, which was preventing the error to be thrown when max loop iteration is reached.

This can more easily be identified with it's flowgraph : (do { 1; } while(0) )

Main:

Details

With this PR:

Details

@HalidOdat HalidOdat added A-Bug Something isn't working C-VM Issues and PRs related to the Boa Virtual Machine. labels Apr 24, 2023
@github-actions

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 94,593 94,593 0
Passed 73,210 73,210 0
Ignored 17,532 17,532 0
Failed 3,851 3,851 0
Panics 0 0 0
Conformance 77.39% 77.39% 0.00%

@HalidOdat HalidOdat mentioned this pull request Apr 24, 2023
3 tasks done
@HalidOdat
HalidOdat marked this pull request as ready for review April 24, 2023 05:51
@codecov

codecov Bot commented Apr 24, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2866 (bca1f53) into main (63d9d67) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2866   +/-   ##
=======================================
  Coverage   50.95%   50.95%           
=======================================
  Files         419      419           
  Lines       41874    41874           
=======================================
  Hits        21335    21335           
  Misses      20539    20539           
Impacted Files Coverage Δ
boa_engine/src/bytecompiler/statement/loop.rs 81.32% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nekevss nekevss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch!

@nekevss

nekevss commented Apr 24, 2023

Copy link
Copy Markdown
Member

bors r+

bors Bot pushed a commit that referenced this pull request Apr 24, 2023
While working on #2857 I discovered that while generating the bytecode for `do-while` loops we were emitting an orphan `LoopContinue` that is never executed, which was preventing the error to be thrown when max loop iteration is reached.

This can more easily be identified with it's flowgraph : (`do { 1; } while(0) `)

Main:

<details>
<img src="https://user-images.githubusercontent.com/8566042/233908011-247313bc-6435-4622-8ecb-f469d9eaf850.png">
</details>

With this PR:

<details>
<img src="https://user-images.githubusercontent.com/8566042/233908030-3552636e-f09c-4c5e-8c7c-1ecfa0024dfe.png">
</details>
@bors

bors Bot commented Apr 24, 2023

Copy link
Copy Markdown

Pull request successfully merged into main.

Build succeeded:

@bors bors Bot changed the title Fix incorrect LoopContinue instruction in while-do loops [Merged by Bors] - Fix incorrect LoopContinue instruction in while-do loops Apr 24, 2023
@bors bors Bot closed this Apr 24, 2023
@bors
bors Bot deleted the fix/do-while-environment branch April 24, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Bug Something isn't working C-VM Issues and PRs related to the Boa Virtual Machine.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants