Skip to content

Commit 111f770

Browse files
committed
remove bad optimization
1 parent 3685255 commit 111f770

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

javascript/ql/lib/semmle/javascript/dataflow/Configuration.qll

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,18 +1160,18 @@ private predicate reachableFromInput(
11601160
}
11611161

11621162
/**
1163-
* Holds if there is a level step from `mid` to `nd` under `cfg` that can be appended
1164-
* to a path represented by `oldSummary` yielding a path represented by `summary`.
1163+
* Holds if there is a level step from `pred` to `succ` under `cfg` that can be appended
1164+
* to a path represented by `oldSummary` yielding a path represented by `newSummary`.
11651165
*/
1166-
pragma[noopt]
1166+
pragma[noinline]
11671167
private predicate appendStep(
1168-
DataFlow::Node mid, DataFlow::Configuration cfg, PathSummary oldSummary, DataFlow::Node nd,
1169-
PathSummary summary
1168+
DataFlow::Node pred, DataFlow::Configuration cfg, PathSummary oldSummary, DataFlow::Node succ,
1169+
PathSummary newSummary
11701170
) {
11711171
exists(PathSummary stepSummary |
1172-
flowStep(mid, cfg, nd, stepSummary) and
1172+
flowStep(pred, cfg, succ, stepSummary) and
11731173
stepSummary.isLevel() and
1174-
summary = oldSummary.append(stepSummary)
1174+
newSummary = oldSummary.append(stepSummary)
11751175
)
11761176
}
11771177

@@ -1317,13 +1317,6 @@ private predicate reachesReturn(
13171317
summary = PathSummary::level() and
13181318
callInputStep(f, _, _, _, _) // check that a relevant result can exist.
13191319
or
1320-
reachesReturnRec(f, read, cfg, summary)
1321-
}
1322-
1323-
pragma[noopt]
1324-
private predicate reachesReturnRec(
1325-
Function f, DataFlow::Node read, DataFlow::Configuration cfg, PathSummary summary
1326-
) {
13271320
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
13281321
flowStep(read, cfg, mid, oldSummary) and
13291322
reachesReturn(f, mid, cfg, newSummary) and
@@ -1614,7 +1607,6 @@ private predicate flowIntoHigherOrderCall(
16141607
* Holds if there is a flow step from `pred` to `succ` described by `summary`
16151608
* under configuration `cfg`.
16161609
*/
1617-
pragma[noinline]
16181610
private predicate flowStep(
16191611
DataFlow::Node pred, DataFlow::Configuration cfg, DataFlow::Node succ, PathSummary summary
16201612
) {

0 commit comments

Comments
 (0)