Dataflow Analysis Issues
Dataflow analysis is a static analysis technique which analyses the control flow graph and the status and potential value of objects at runtime to identify undefined behaviour, logical anomalies or other issues which are of interest such as:
Invalid Pointer Operations
- Dereferencing a null pointer
- Performing arithmetic operations on a null pointer
- Computing an invalid pointer value
- Dereferencing an invalid pointer value
Dangerous Arithmetic Operations
- Division by zero
- Arithmetic operations on signed data resulting in overflow
- Arithmetic operations on unsigned data resulting in wraparound
- Converting a value to a signed type in which it is not representable
- Converting a negative value to an unsigned type
- Converting a positive value to an unsigned type in which it is not representable
- Performing a left shift operation on unsigned data resulting in truncation of bits
- Performing a left shift operation on signed data resulting in an implementation defined value
- Performing a shift operation with a right hand operand which is negative or too large
- Assigning a negative value which requires a "two's complement" representation.
Flow Control Anomalies
- Redundant initializations
- Redundant assignments
- Invariant logical operations
- Invariant controlling expressions in loop statements and 'if' statements
- Unreachable code
- Infinite loops
- Executing an implicit return statement in a function with non-void return type
- Using the value of unset data
Index