Skip to content

Commit e536cec

Browse files
committed
C++: Fix FP caused by a variable missing type information.
1 parent 46fbb2a commit e536cec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ DeclStmt declWithNoInit(LocalVariable v) {
4141
result.getADeclaration() = v and
4242
not exists(v.getInitializer()) and
4343
/* The type of the variable is not stack-allocated. */
44-
not allocatedType(v.getType())
44+
exists(Type t | t = v.getType() | not allocatedType(t))
4545
}
4646

4747
class UninitialisedLocalReachability extends StackVariableReachability {

0 commit comments

Comments
 (0)