Skip to content

Commit b7542ee

Browse files
committed
C++: Fix more inconsistencies (and delete unnecessary override).
1 parent 43df4a9 commit b7542ee

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/StdContainer.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ class StdSequenceContainerPush extends MemberFunction, SideEffectFunction, Alias
9292
}
9393

9494
override predicate hasSpecificReadSideEffect(ParameterIndex i, boolean buffer) {
95-
i = 0 and buffer = false
95+
// the `std::vector<bool>` specialization doesn't take a reference as a
96+
// parameter. So we need to check that the parameter is actually a
97+
// reference.
98+
this.getParameter(i).getUnspecifiedType() instanceof ReferenceType and
99+
buffer = false
96100
}
97101
}
98102

@@ -471,8 +475,6 @@ private class InitializerListConstructor extends Constructor, SideEffectFunction
471475
override predicate hasSpecificWriteSideEffect(ParameterIndex i, boolean buffer, boolean mustWrite) {
472476
i = -1 and buffer = false and mustWrite = true
473477
}
474-
475-
override predicate hasSpecificReadSideEffect(ParameterIndex i, boolean buffer) { none() }
476478
}
477479

478480
/**

0 commit comments

Comments
 (0)