mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Fix guard basic block for switch cases
This commit is contained in:
@@ -450,6 +450,20 @@ class SwitchCase extends Stmt, @case {
|
||||
result = this.getSwitch().getExpr() or result = this.getSwitchExpr().getExpr()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `i`th case in this case's switch block.
|
||||
*/
|
||||
SwitchCase getSiblingCase(int i) {
|
||||
result = this.getSwitch().getCase(i) or result = this.getSwitchExpr().getCase(i)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets this case's ordinal in its switch block.
|
||||
*/
|
||||
int getCaseIndex() {
|
||||
this = this.getSwitch().getCase(result) or this = this.getSwitchExpr().getCase(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this `case` is a switch labeled rule of the form `... -> ...`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user