CodeQL library for C/C++
Search

Class PostUpdateNode

A node associated with an object after an operation that might have changed its state.

This can be either the argument to a callable after the callable returns (which might have mutated the argument), or the qualifier of a field after an update to the field.

Nodes corresponding to AST elements, for example ExprNode, usually refer to the value before the update with the exception of ClassInstanceExpr, which represents the value after the constructor has run.

This class exists to match the interface used by Java. There are currently no non-abstract classes that extend it. When we implement field flow, we can revisit this.

Import path

import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil

Direct supertypes

Indirect supertypes

Known direct subtypes

    Inherited fields

    Predicates

    getPreUpdateNode

    Gets the node before the state update.

    Inherited predicates

    asConvertedExpr

    Gets the expression corresponding to this node, if any. The returned expression may be a Conversion.

    from Node
    asDefiningArgument

    Gets the argument that defines this DefinitionByReferenceNode, if any. This predicate should be used instead of asExpr when referring to the value of a reference argument after the call has returned. For example, in f(&x), this predicate will have &x as its result for the Node that represents the new value of x.

    from Node
    asExpr

    Gets the non-conversion expression corresponding to this node, if any. This predicate only has a result on nodes that represent the value of evaluating the expression. For data flowing out of an expression, like when an argument is passed by reference, use asDefiningArgument instead of asExpr.

    from Node
    asInstruction

    Gets the instruction corresponding to this node, if any.

    from Node
    asOperand

    Gets the operands corresponding to this node, if any.

    from Node
    asParameter

    Gets the positional parameter corresponding to this node, if any.

    from Node
    asPartialDefinition

    Gets the expression that is partially defined by this node, if any.

    from Node
    asUninitialized

    DEPRECATED: See UninitializedNode.

    from Node
    asVariable

    Gets the variable corresponding to this node, if any. This can be used for modeling flow in and out of global variables.

    from Node
    getEnclosingCallable

    INTERNAL: Do not use.

    from InstructionNode
    getFunction

    Gets the function to which this node belongs, if any.

    from InstructionNode
    getInstruction

    Gets the instruction corresponding to this node.

    from InstructionNode
    getLocation

    Gets the location of this element.

    from InstructionNode
    getType

    Gets the type of this node.

    from InstructionNode
    getTypeBound

    Gets an upper bound on the type of this node.

    from Node
    hasLocationInfo

    Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

    from Node
    toString

    Gets a textual representation of this element.

    from InstructionNode