Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): fix the debug bound checks of the CFG visitor #3400

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 11, 2022

Summary

Fixes #3390

The NodeVisitor implementation used to build the Control Flow Graph has some additional checks in debug mode to ensure the CFG builder for a given function does not access any state belonging to another function, but offsets in the visitor state stack were not properly calculated to account for this leading to panics when break or continue statements needed to access said stack.

Test Plan

I added an additional test case that could reliably reproduce the panic before the fix, and no longer does with the changes applied.

@leops leops requested a review from xunilrj as a code owner October 11, 2022 12:46
@leops leops temporarily deployed to netlify-playground October 11, 2022 12:46 Inactive
@netlify
Copy link

netlify bot commented Oct 11, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit af1814c
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/634565a8e81da700089b5d5e

@github-actions
Copy link

@leops leops merged commit a9aeb07 into main Oct 11, 2022
@leops leops deleted the fix/cfg-debug-assert branch October 11, 2022 14:13
@leops leops added the A-Linter Area: linter label Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Control flow visitor: Index out of bounds
2 participants