mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Revert "C++: Don't count write operations as uses."
This reverts commit 092beb8b73.
This commit is contained in:
@@ -182,16 +182,10 @@ private class ReturnParameterIndirection extends Use, TReturnParamIndirection {
|
||||
}
|
||||
|
||||
private predicate isExplicitUse(Operand op) {
|
||||
exists(VariableAddressInstruction vai | vai = op.getDef() |
|
||||
// Don't include this operand as a use if it only exists to initialize the
|
||||
// indirection of a parameter.
|
||||
not exists(LoadInstruction load |
|
||||
load.getSourceAddressOperand() = op and
|
||||
load.getAUse().getUse() instanceof InitializeIndirectionInstruction
|
||||
) and
|
||||
// Don't include this operand as a use if the only use of the address is for a write
|
||||
// that definately overrides a variable.
|
||||
not (explicitWrite(true, _, vai) and exists(unique( | | vai.getAUse())))
|
||||
op.getDef() instanceof VariableAddressInstruction and
|
||||
not exists(LoadInstruction load |
|
||||
load.getSourceAddressOperand() = op and
|
||||
load.getAUse().getUse() instanceof InitializeIndirectionInstruction
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user