C++: Add 'InheritanceConversionInstruction' to the list of instructions that set 'certain = false' in 'explicitWrite'.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-11-02 13:02:46 +00:00
parent 56cabb8f46
commit 3e6ac74d73

View File

@@ -315,11 +315,14 @@ predicate explicitWrite(boolean certain, Instruction instr, Instruction address)
exists(StoreInstruction store | exists(StoreInstruction store |
store = instr and addressFlowTC(address, store.getDestinationAddress()) store = instr and addressFlowTC(address, store.getDestinationAddress())
| |
// Set `certain = false` if the address is derived from any instructions that prevents us from
// concluding that the entire variable is overridden.
if if
addressFlowTC(any(Instruction i | addressFlowTC(any(Instruction i |
i instanceof FieldAddressInstruction or i instanceof FieldAddressInstruction or
i instanceof PointerArithmeticInstruction or i instanceof PointerArithmeticInstruction or
i instanceof LoadInstruction i instanceof LoadInstruction or
i instanceof InheritanceConversionInstruction
), store.getDestinationAddress()) ), store.getDestinationAddress())
then certain = false then certain = false
else certain = true else certain = true