C++: Also clear the 0'th argument of 'swap'.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-02-07 10:31:18 +00:00
parent c5dc88345d
commit 4b046ad670
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
}