Merge pull request #15537 from MathiasVP/swap-also-clears-first-argument

C++: Also clear the `0`'th argument of `swap`
This commit is contained in:
Mathias Vorreiter Pedersen
2024-02-07 14:35:31 +00:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ private class Swap extends DataFlowFunction, FlowOutBarrierFunction {
output.isParameterDeref(0)
}
override predicate isFlowOutBarrier(FunctionInput input) { input.isParameterDeref(1) }
override predicate isFlowOutBarrier(FunctionInput input) { input.isParameterDeref([0, 1]) }
}
/**

View File

@@ -212,7 +212,7 @@ void test_swap() {
std::swap(x, y);
sink(x); // $ SPURIOUS: ast,ir
sink(x); // $ SPURIOUS: ast
sink(y); // $ ast,ir
}