Repository navigation
fix(js): give a dead region the reason of the terminator that starts it - #211
Merged
Merged
Conversation
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.
Ports pyscn
175de1f(pyscn#471), whichjscan/SYNC.mdheld back until #172 was fixed.A dead block took its reason from the last statement of a predecessor or from its own label. A block further down a dead region, such as the body of an
if, a loop or acatchafter areturn, matched neither, so it was reported as anunreachable_branchwarning. Findings of different reasons are not merged, so one dead region came out as several findings.The detector now walks forward from each block the CFG builder created after a
return,throw,breakorcontinue. Every unreachable block on that walk takes that terminator's reason and critical severity, so the region merges into one finding.A closing
}is not a CFG statement, so a region whose nestedifor loop ends before more dead code is still split at that line.jscan/SYNC.mdrecords this gap. Onimbue-ai/latchkeyandsindresorhus/gotthe findings do not change.