C++: Fix 'case 2' in 'destroyedToBeginSink' now that we're working with the sink instead of the source.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-16 22:07:38 +01:00
parent d22e2bae8e
commit eb2790ae63

View File

@@ -65,10 +65,11 @@ DataFlow::Node getADestroyedNode() {
isPostUpdateOfQualifier(destructorCall, result)
)
or
// Case 2: Anything that was derived from the temporary that is now destroyed
// is also destroyed.
exists(CallInstruction call |
result.asInstruction() = call and
DataFlow::localFlow(destroyedTemp.getNode(),
DataFlow::operandNode(call.getThisArgumentOperand()))
DataFlow::localFlow(DataFlow::operandNode(call.getThisArgumentOperand()), n)
|
call.getStaticCallTarget() instanceof StdSequenceContainerAt or
call.getStaticCallTarget() instanceof StdMapAt