CFG: Support for fall-through switches#127
Open
RomainDeg wants to merge 4 commits into
Open
Conversation
…ifferent context classes
(switches isFull attribute is computable and identical to try nodes, the node is full if it has a nil branch, either a default or the block following the switch)
… use in switch build method
jecisc
reviewed
Jun 22, 2026
jecisc
left a comment
Member
There was a problem hiding this comment.
I wonder if it would not be simpler instead of creating a new entry,
|
|
||
| "I reset the fall-through case if needed, and check if this new case ends with a break or not." | ||
| fallThroughCase := nil. | ||
| aBlock statements last isBreakStatement ifFalse: [ fallThroughCase := aBlock ] |
Member
There was a problem hiding this comment.
Suggested change
| aBlock statements last isBreakStatement ifFalse: [ fallThroughCase := aBlock ] | |
| aBlock endsWithBreakStatement ifFalse: [ fallThroughCase := aBlock ] |
I'll load it an review it further this week, but here is a simple improvement that can be done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains:
FASTCFGContextEntryclass as parameter.isFullattributes of multiple conditional nodes. Switches are now considered full identically to try blocks, if they have a nil branch pointing to a node (which is either a default node, or the block representing the instructions after the switch).FASTCFGFallThroughSwitchContextEntryand a builder methodbuildAndUseFallThroughSwitchDuring: