Skip to content

Commit e72232f

Browse files
committed
JS: Add more overlay[caller?] annotations
1 parent 66febb2 commit e72232f

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
@@ -174,6 +174,7 @@ class AstNode extends @ast_node, NodeInStmtContainer {
174174
* The TypeScript compiler emits no code for ambient declarations, but they
175175
* can affect name resolution and type checking at compile-time.
176176
*/
177+
overlay[caller?]
177178
pragma[inline]
178179
predicate isAmbient() {
179180
this.isAmbientInternal()

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

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

3434
/** Holds if this location starts before location `that`. */
35+
overlay[caller]
3536
pragma[inline]
3637
predicate startsBefore(Location that) {
3738
exists(string f, int sl1, int sc1, int sl2, int sc2 |
@@ -45,6 +46,7 @@ final class Location extends @location_default {
4546
}
4647

4748
/** Holds if this location ends after location `that`. */
49+
overlay[caller]
4850
pragma[inline]
4951
predicate endsAfter(Location that) {
5052
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
@@ -238,6 +238,7 @@ module PromiseTypeTracking {
238238
*
239239
* These type-tracking steps are already included in the default type-tracking steps (through `PreCallGraphStep`).
240240
*/
241+
overlay[caller?]
241242
pragma[inline]
242243
DataFlow::Node promiseStep(DataFlow::Node pred, StepSummary summary) {
243244
exists(string field | field = Promises::valueProp() |
@@ -256,6 +257,7 @@ module PromiseTypeTracking {
256257
* Gets the result from a single step through a promise, from `pred` with tracker `t2` to `result` with tracker `t`.
257258
* 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.
258259
*/
260+
overlay[caller?]
259261
pragma[inline]
260262
DataFlow::SourceNode promiseStep(
261263
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
@@ -1436,6 +1436,7 @@ module DataFlow {
14361436
/**
14371437
* Gets the data flow node corresponding to `e`.
14381438
*/
1439+
overlay[caller?]
14391440
pragma[inline]
14401441
ExprNode exprNode(Expr e) { result = valueNode(e) }
14411442

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ module Public {
197197
*/
198198
class ContentSet extends TContentSet {
199199
/** Gets a content that may be stored into when storing into this set. */
200+
overlay[caller?]
200201
pragma[inline]
201202
Content getAStoreContent() {
202203
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
@@ -762,6 +762,7 @@ class ContentApprox extends TContentApprox {
762762
}
763763
}
764764

765+
overlay[global]
765766
pragma[inline]
766767
ContentApprox getContentApprox(Content c) {
767768
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
@@ -96,6 +96,7 @@ module SsaDataflowInput implements DataFlowIntegrationInputSig {
9696
}
9797
}
9898

99+
overlay[caller?]
99100
pragma[inline]
100101
predicate guardDirectlyControlsBlock(Guard guard, js::Cfg::BasicBlock bb, GuardValue branch) {
101102
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
@@ -195,6 +195,7 @@ API::Node getExtraSuccessorFromNode(API::Node node, AccessPathTokenBase token) {
195195
}
196196

197197
bindingset[node]
198+
overlay[caller?]
198199
pragma[inline_late]
199200
private API::Node getAGuardedRouteHandlerApprox(API::Node node) {
200201
// For now just get any routing node with the same root (i.e. the same web app), as
@@ -235,6 +236,7 @@ private predicate blockFuzzyCall(DataFlow::CallNode call) {
235236
isCommonBuiltinMethodName(call.getCalleeName())
236237
}
237238

239+
overlay[caller?]
238240
pragma[inline]
239241
API::Node getAFuzzySuccessor(API::Node node) {
240242
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
@@ -48,6 +48,7 @@ class NodeInStmtContainer extends Locatable, @node_in_stmt_container {
4848
/**
4949
* Gets the function or toplevel to which this node belongs.
5050
*/
51+
overlay[caller]
5152
pragma[inline]
5253
final StmtContainer getContainer() { result = getStmtContainer(this) }
5354
}

0 commit comments

Comments
 (0)