Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5aa1b13

Browse files
committed
C++: Make the pre update node for ExplicitFieldStoreQualifierNode an operand node. This fixes the IR dataflow consistency errors.
1 parent 470ee00 commit 5aa1b13

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ abstract class PostUpdateNode extends InstructionNode {
317317
* setY(&x); // a partial definition of the object `x`.
318318
* ```
319319
*/
320-
abstract private class PartialDefinitionNode extends PostUpdateNode, TInstructionNode {
320+
abstract private class PartialDefinitionNode extends PostUpdateNode {
321321
abstract Expr getDefinedExpr();
322322
}
323323

@@ -332,11 +332,7 @@ private class ExplicitFieldStoreQualifierNode extends PartialDefinitionNode {
332332
)
333333
}
334334

335-
// There might be multiple `ChiInstructions` that has a particular instruction as
336-
// the total operand - so this definition gives consistency errors in
337-
// DataFlowImplConsistency::Consistency. However, it's not clear what (if any) implications
338-
// this consistency failure has.
339-
override Node getPreUpdateNode() { result.asInstruction() = instr.getTotal() }
335+
override Node getPreUpdateNode() { result.asOperand() = instr.getTotalOperand() }
340336

341337
override Expr getDefinedExpr() {
342338
result = field.getObjectAddress().getUnconvertedResultExpression()

0 commit comments

Comments
 (0)