Skip to content

Commit f0a994a

Browse files
author
Dave Bartolomeo
committed
C++: Fix pointer flow modeling for smart pointer setters
1 parent 653ef9d commit f0a994a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp/ql/src/semmle/code/cpp/models/implementations/SmartPointer.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ private class SmartPtrSetterFunction extends MemberFunction, AliasFunction, Side
158158
// parameter.
159159
result.isParameter(1)
160160
else result.isParameterDeref(0)
161+
or
162+
// One of the functions that takes ownership of a raw pointer.
163+
param0.getUnspecifiedType() instanceof PointerType and
164+
result.isParameter(0)
161165
)
162-
or
163-
// One of the functions that takes ownership of a raw pointer.
164-
param0.getUnspecifiedType() instanceof PointerType and
165-
result.isParameter(0)
166166
)
167167
}
168168
}

0 commit comments

Comments
 (0)