@@ -61,7 +61,7 @@ predicate stackPointerFlowsToUse(Expr use, Type useType, Expr source, boolean is
6161 stackPointerFlowsToUse ( use .( PointerAddExpr ) .getAnOperand ( ) , useType , source , isLocal )
6262 or
6363 // Indirect use of a stack address.
64- exists ( SsaDefinition def , LocalScopeVariable var |
64+ exists ( SsaDefinition def , StackVariable var |
6565 stackPointerFlowsToDef ( def , var , useType , source , isLocal ) and
6666 use = def .getAUse ( var )
6767 )
@@ -97,8 +97,7 @@ private PointerType getExprPtrType(Expr use) { result = use.getUnspecifiedType()
9797
9898predicate stackReferenceFlowsToUse ( Expr use , Type useType , Expr source , boolean isLocal ) {
9999 // Stack variables
100- exists ( LocalScopeVariable var |
101- not var .isStatic ( ) and
100+ exists ( StackVariable var |
102101 use = source and
103102 source = var .getAnAccess ( ) and
104103 isLocal = true and
@@ -140,7 +139,7 @@ predicate stackReferenceFlowsToUse(Expr use, Type useType, Expr source, boolean
140139 stackPointerFlowsToUse ( use .( PointerDereferenceExpr ) .getOperand ( ) , useType , source , isLocal )
141140 or
142141 // Indirect use of a stack reference, via a reference variable.
143- exists ( SsaDefinition def , LocalScopeVariable var |
142+ exists ( SsaDefinition def , StackVariable var |
144143 stackReferenceFlowsToDef ( def , var , useType , source , isLocal ) and
145144 use = def .getAUse ( var )
146145 )
@@ -162,7 +161,7 @@ predicate stackReferenceFlowsToUse(Expr use, Type useType, Expr source, boolean
162161 * addresses through SSA definitions.
163162 */
164163predicate stackPointerFlowsToDef (
165- SsaDefinition def , LocalScopeVariable var , Type useType , Expr source , boolean isLocal
164+ SsaDefinition def , StackVariable var , Type useType , Expr source , boolean isLocal
166165) {
167166 stackPointerFlowsToUse ( def .getDefiningValue ( var ) , useType , source , isLocal )
168167 or
@@ -184,7 +183,7 @@ predicate stackPointerFlowsToDef(
184183 * int&, rather than pointers.
185184 */
186185predicate stackReferenceFlowsToDef (
187- SsaDefinition def , LocalScopeVariable var , Type useType , Expr source , boolean isLocal
186+ SsaDefinition def , StackVariable var , Type useType , Expr source , boolean isLocal
188187) {
189188 // Check that the type of the variable is a reference type and delegate
190189 // the rest of the work to stackReferenceFlowsToDef_Impl.
@@ -197,7 +196,7 @@ predicate stackReferenceFlowsToDef(
197196 * predicate.
198197 */
199198predicate stackReferenceFlowsToDef_Impl (
200- SsaDefinition def , LocalScopeVariable var , Type useType , Expr source , boolean isLocal
199+ SsaDefinition def , StackVariable var , Type useType , Expr source , boolean isLocal
201200) {
202201 stackReferenceFlowsToUse ( def .getDefiningValue ( var ) , useType , source , isLocal )
203202 or
@@ -213,7 +212,7 @@ predicate stackReferenceFlowsToDef_Impl(
213212}
214213
215214/** The type of the variable is a reference type, such as int&. */
216- predicate isReferenceVariable ( LocalScopeVariable var ) {
215+ predicate isReferenceVariable ( StackVariable var ) {
217216 var .getUnspecifiedType ( ) instanceof ReferenceType
218217}
219218
@@ -284,7 +283,7 @@ predicate memberFcnMightRunOnStack(MemberFunction fcn, Type useType) {
284283predicate constructorMightRunOnStack ( Constructor constructor ) {
285284 exists ( ConstructorCall call | call .getTarget ( ) = constructor |
286285 // Call to a constructor from a stack variable's initializer.
287- exists ( LocalScopeVariable var | var .getInitializer ( ) .getExpr ( ) = call )
286+ exists ( StackVariable var | var .getInitializer ( ) .getExpr ( ) = call )
288287 or
289288 // Call to a constructor from another constructor which might
290289 // also run on the stack.
0 commit comments