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

Fixed the bug with labels not being duplicated across branches #54

Merged
merged 1 commit into from
Sep 24, 2023

Conversation

AjayBrahmakshatriya
Copy link
Collaborator

Fixes #53

The bug in the referenced issue was because of jumps and jump targets being duplicated across branches due to "failure to merge". This causes the jump to target a label that is in a different branch messing up the loop_finder invariant.

We fixed this by inserting labels at all possible jump targets for a particular static label. We then maintain the current label from the stmt block and update it when we visit a new one. This way a goto stmt always sees a structured label.

Sample 50 has been added to test the same.

@AjayBrahmakshatriya AjayBrahmakshatriya merged commit d065b21 into BuildIt-lang:master Sep 24, 2023
2 checks passed
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.

Bug in control flow extraction when blocks with jump labels are duplicated
1 participant