Skip to content

Commit 43df4a9

Browse files
committed
C++: Fix inconsistencies.
1 parent db9cd1f commit 43df4a9

File tree

1 file changed

+8
-1
lines changed
  • cpp/ql/lib/semmle/code/cpp/models/implementations

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ private class StdPairConstructor extends Constructor, TaintFunction, AliasFuncti
7777
}
7878

7979
override predicate hasSpecificReadSideEffect(ParameterIndex i, boolean buffer) {
80-
i = [0, 1] and buffer = false
80+
// All the constructor parameters are references with the exception of this one:
81+
// ```
82+
// template<class... Args1, class... Args2>
83+
// pair(std::piecewise_construct_t, std::tuple<Args1...> first_args, std::tuple<Args2...> second_args);
84+
// ```
85+
// So we need to check that the parameters are actually references
86+
this.getParameter(i).getUnspecifiedType() instanceof ReferenceType and
87+
buffer = false
8188
}
8289
}
8390

0 commit comments

Comments
 (0)