Skip to content

Commit be26a48

Browse files
committed
use pragma[only_bind_into] to prevent bad join in Ssa::hasLocationInfo
1 parent ccd706e commit be26a48

File tree

1 file changed

+8
-2
lines changed
  • javascript/ql/src/semmle/javascript

1 file changed

+8
-2
lines changed

javascript/ql/src/semmle/javascript/SSA.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,10 @@ class SsaExplicitDefinition extends SsaDefinition, TExplicitDef {
520520
override predicate hasLocationInfo(
521521
string filepath, int startline, int startcolumn, int endline, int endcolumn
522522
) {
523-
getDef().getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
523+
exists(Location loc |
524+
pragma[only_bind_into](loc) = pragma[only_bind_into](getDef()).getLocation() and
525+
loc.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
526+
)
524527
}
525528

526529
/**
@@ -552,7 +555,10 @@ abstract class SsaImplicitDefinition extends SsaDefinition {
552555
) {
553556
endline = startline and
554557
endcolumn = startcolumn and
555-
getBasicBlock().getLocation().hasLocationInfo(filepath, startline, startcolumn, _, _)
558+
exists(Location loc |
559+
pragma[only_bind_into](loc) = pragma[only_bind_into](getBasicBlock()).getLocation() and
560+
loc.hasLocationInfo(filepath, startline, startcolumn, _, _)
561+
)
556562
}
557563
}
558564

0 commit comments

Comments
 (0)