Skip to content

Commit a7a0d09

Browse files
committed
JS: Add more overlay[caller?] annotations
1 parent 56f69bf commit a7a0d09

File tree

10 files changed

+13
-0
lines changed

10 files changed

+13
-0
lines changed

javascript/ql/lib/semmle/javascript/AST.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class AstNode extends @ast_node, NodeInStmtContainer {
172172
* The TypeScript compiler emits no code for ambient declarations, but they
173173
* can affect name resolution and type checking at compile-time.
174174
*/
175+
overlay[caller?]
175176
pragma[inline]
176177
predicate isAmbient() {
177178
this.isAmbientInternal()

javascript/ql/lib/semmle/javascript/Locations.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ final class Location extends @location_default {
3030
int getNumLines() { result = this.getEndLine() - this.getStartLine() + 1 }
3131

3232
/** Holds if this location starts before location `that`. */
33+
overlay[caller]
3334
pragma[inline]
3435
predicate startsBefore(Location that) {
3536
exists(string f, int sl1, int sc1, int sl2, int sc2 |
@@ -43,6 +44,7 @@ final class Location extends @location_default {
4344
}
4445

4546
/** Holds if this location ends after location `that`. */
47+
overlay[caller]
4648
pragma[inline]
4749
predicate endsAfter(Location that) {
4850
exists(string f, int el1, int ec1, int el2, int ec2 |

javascript/ql/lib/semmle/javascript/Promises.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ module PromiseTypeTracking {
236236
*
237237
* These type-tracking steps are already included in the default type-tracking steps (through `PreCallGraphStep`).
238238
*/
239+
overlay[caller?]
239240
pragma[inline]
240241
DataFlow::Node promiseStep(DataFlow::Node pred, StepSummary summary) {
241242
exists(string field | field = Promises::valueProp() |
@@ -254,6 +255,7 @@ module PromiseTypeTracking {
254255
* Gets the result from a single step through a promise, from `pred` with tracker `t2` to `result` with tracker `t`.
255256
* This can be loading a resolved value from a promise, storing a value in a promise, or copying a resolved value from one promise to another.
256257
*/
258+
overlay[caller?]
257259
pragma[inline]
258260
DataFlow::SourceNode promiseStep(
259261
DataFlow::SourceNode pred, DataFlow::TypeTracker t, DataFlow::TypeTracker t2

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,7 @@ module DataFlow {
14241424
/**
14251425
* Gets the data flow node corresponding to `e`.
14261426
*/
1427+
overlay[caller?]
14271428
pragma[inline]
14281429
ExprNode exprNode(Expr e) { result = valueNode(e) }
14291430

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ module Public {
194194
*/
195195
class ContentSet extends TContentSet {
196196
/** Gets a content that may be stored into when storing into this set. */
197+
overlay[caller?]
197198
pragma[inline]
198199
Content getAStoreContent() {
199200
result = this.asSingleton()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ class ContentApprox extends TContentApprox {
742742
}
743743
}
744744

745+
overlay[global]
745746
pragma[inline]
746747
ContentApprox getContentApprox(Content c) {
747748
c instanceof MkPropertyContent and result = TApproxPropertyContent()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ private predicate legacyPostUpdateStep(DataFlow::Node pred, DataFlow::Node succ)
4848
* Holds if data can flow in one step from `pred` to `succ`, taking
4949
* additional steps from the configuration into account.
5050
*/
51+
overlay[caller?]
5152
pragma[inline]
5253
deprecated predicate localFlowStep(
5354
DataFlow::Node pred, DataFlow::Node succ, DataFlow::Configuration configuration,

javascript/ql/lib/semmle/javascript/dataflow/internal/sharedlib/Ssa.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ module SsaDataflowInput implements DataFlowIntegrationInputSig {
9494
}
9595
}
9696

97+
overlay[caller?]
9798
pragma[inline]
9899
predicate guardDirectlyControlsBlock(Guard guard, js::Cfg::BasicBlock bb, GuardValue branch) {
99100
exists(js::ConditionGuardNode g |

javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModelsSpecific.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ API::Node getExtraSuccessorFromNode(API::Node node, AccessPathTokenBase token) {
190190
}
191191

192192
bindingset[node]
193+
overlay[caller?]
193194
pragma[inline_late]
194195
private API::Node getAGuardedRouteHandlerApprox(API::Node node) {
195196
// For now just get any routing node with the same root (i.e. the same web app), as
@@ -230,6 +231,7 @@ private predicate blockFuzzyCall(DataFlow::CallNode call) {
230231
isCommonBuiltinMethodName(call.getCalleeName())
231232
}
232233

234+
overlay[caller?]
233235
pragma[inline]
234236
API::Node getAFuzzySuccessor(API::Node node) {
235237
result = node.getAMember() and

javascript/ql/lib/semmle/javascript/internal/StmtContainers.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class NodeInStmtContainer extends Locatable, @node_in_stmt_container {
4646
/**
4747
* Gets the function or toplevel to which this node belongs.
4848
*/
49+
overlay[caller]
4950
pragma[inline]
5051
final StmtContainer getContainer() { result = getStmtContainer(this) }
5152
}

0 commit comments

Comments
 (0)