Skip to content

Commit 5d0a4ca

Browse files
author
Dave Bartolomeo
committed
C++: Add {AllAliased} side effects for smart pointers
Smart pointer constructors, assignments, and `reset()` can actually have fairly large side effects, especially with custom deleters, destructors for objects being destroyed, and so on. I've re-introduced `{AllAliased}` side effects for these functions. There was no immediate effect on analysis results.
1 parent 3832100 commit 5d0a4ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ private class SmartPtrSetterFunction extends MemberFunction, AliasFunction, Side
106106
)
107107
}
108108

109-
override predicate hasOnlySpecificReadSideEffects() { this instanceof Constructor }
109+
override predicate hasOnlySpecificReadSideEffects() { none() }
110110

111-
override predicate hasOnlySpecificWriteSideEffects() { this instanceof ConstMemberFunction }
111+
override predicate hasOnlySpecificWriteSideEffects() { none() }
112112

113113
override predicate hasSpecificWriteSideEffect(ParameterIndex i, boolean buffer, boolean mustWrite) {
114114
// Always write to the destination smart pointer itself.

0 commit comments

Comments
 (0)