Skip to content

Commit e87e543

Browse files
committed
JS: Ensure optional steps/barriers are computed in the correct stage
1 parent 7790f68 commit e87e543

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/FlowSummaryPrivate.qll

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ string encodeArgumentPosition(ArgumentPosition pos) {
126126
}
127127

128128
/** Gets the return kind corresponding to specification `"ReturnValue"`. */
129-
ReturnKind getStandardReturnValueKind() { result = MkNormalReturnKind() }
129+
ReturnKind getStandardReturnValueKind() { result = MkNormalReturnKind() and Stage::ref() }
130130

131131
private module FlowSummaryStepInput implements Private::StepsInputSig {
132132
DataFlowCall getACall(SummarizedCallable sc) {
@@ -238,3 +238,12 @@ ContentSet decodeUnknownWithoutContent(AccessPathSyntax::AccessPathTokenBase tok
238238
*/
239239
bindingset[token]
240240
ContentSet decodeUnknownWithContent(AccessPathSyntax::AccessPathTokenBase token) { none() }
241+
242+
cached
243+
module Stage {
244+
cached
245+
predicate ref() { 1 = 1 }
246+
247+
cached
248+
predicate backref() { optionalStep(_, _, _) }
249+
}

0 commit comments

Comments
 (0)