Fix a bad join order on locations.

This commit is contained in:
Alex Eyers-Taylor
2025-04-04 16:55:30 +01:00
parent f948d1cf4e
commit b8c9f72e60

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."