Skip to content

Commit ad5619f

Browse files
committed
Revert "C++: Don't count write operations as uses."
This reverts commit 092beb8.
1 parent 3e6ac74 commit ad5619f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,10 @@ private class ReturnParameterIndirection extends Use, TReturnParamIndirection {
182182
}
183183

184184
private predicate isExplicitUse(Operand op) {
185-
exists(VariableAddressInstruction vai | vai = op.getDef() |
186-
// Don't include this operand as a use if it only exists to initialize the
187-
// indirection of a parameter.
188-
not exists(LoadInstruction load |
189-
load.getSourceAddressOperand() = op and
190-
load.getAUse().getUse() instanceof InitializeIndirectionInstruction
191-
) and
192-
// Don't include this operand as a use if the only use of the address is for a write
193-
// that definately overrides a variable.
194-
not (explicitWrite(true, _, vai) and exists(unique( | | vai.getAUse())))
185+
op.getDef() instanceof VariableAddressInstruction and
186+
not exists(LoadInstruction load |
187+
load.getSourceAddressOperand() = op and
188+
load.getAUse().getUse() instanceof InitializeIndirectionInstruction
195189
)
196190
}
197191

0 commit comments

Comments
 (0)