Skip to content

Commit cfa60a8

Browse files
committed
remove bad optimization
1 parent df44ba9 commit cfa60a8

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
@@ -1151,18 +1151,18 @@ private predicate reachableFromInput(
11511151
}
11521152

11531153
/**
1154-
* Holds if there is a level step from `mid` to `nd` under `cfg` that can be appended
1155-
* to a path represented by `oldSummary` yielding a path represented by `summary`.
1154+
* Holds if there is a level step from `pred` to `succ` under `cfg` that can be appended
1155+
* to a path represented by `oldSummary` yielding a path represented by `newSummary`.
11561156
*/
1157-
pragma[noopt]
1157+
pragma[noinline]
11581158
private predicate appendStep(
1159-
DataFlow::Node mid, DataFlow::Configuration cfg, PathSummary oldSummary, DataFlow::Node nd,
1160-
PathSummary summary
1159+
DataFlow::Node pred, DataFlow::Configuration cfg, PathSummary oldSummary, DataFlow::Node succ,
1160+
PathSummary newSummary
11611161
) {
11621162
exists(PathSummary stepSummary |
1163-
flowStep(mid, cfg, nd, stepSummary) and
1163+
flowStep(pred, cfg, succ, stepSummary) and
11641164
stepSummary.isLevel() and
1165-
summary = oldSummary.append(stepSummary)
1165+
newSummary = oldSummary.append(stepSummary)
11661166
)
11671167
}
11681168

@@ -1301,13 +1301,6 @@ private predicate reachesReturn(
13011301
summary = PathSummary::level() and
13021302
callInputStep(f, _, _, _, _) // check that a relevant result can exist.
13031303
or
1304-
reachesReturnRec(f, read, cfg, summary)
1305-
}
1306-
1307-
pragma[noopt]
1308-
private predicate reachesReturnRec(
1309-
Function f, DataFlow::Node read, DataFlow::Configuration cfg, PathSummary summary
1310-
) {
13111304
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
13121305
flowStep(read, cfg, mid, oldSummary) and
13131306
reachesReturn(f, mid, cfg, newSummary) and
@@ -1598,7 +1591,6 @@ private predicate flowIntoHigherOrderCall(
15981591
* Holds if there is a flow step from `pred` to `succ` described by `summary`
15991592
* under configuration `cfg`.
16001593
*/
1601-
pragma[noinline]
16021594
private predicate flowStep(
16031595
DataFlow::Node pred, DataFlow::Configuration cfg, DataFlow::Node succ, PathSummary summary
16041596
) {

0 commit comments

Comments
 (0)