mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
C++: Add 'InheritanceConversionInstruction' to the list of instructions that set 'certain = false' in 'explicitWrite'.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user