Fix a bad join order on locations.

This commit is contained in:
Alex Eyers-Taylor
2025-04-04 16:55:30 +01:00
parent 29fcbe3c8f
commit 2c3442d4eb

View File

@@ -12,8 +12,11 @@
import javascript
from LabeledStmt l, Case c
where
int labelInCaseStartColumn(Case c, LabeledStmt l) {
l = c.getAChildStmt+() and
l.getLocation().getStartColumn() = c.getLocation().getStartColumn()
result = l.getLocation().getStartColumn()
}
from LabeledStmt l, Case c
where labelInCaseStartColumn(c, l) = c.getLocation().getStartColumn()
select l.getChildExpr(0), "Non-case labels in switch statements are confusing."