Data Flow Checks
Data flow checks in Polyspace® Code Prover™ check for run-time errors related to flow of information in a program, such as:
Whether a variable being read is initialized.
Whether a branch of a conditional statement is reachable.
Whether a function is called at run time.
Polyspace Results
Function not called | Function is defined but not called |
Function not reachable | Function is called from unreachable part of code |
Global variable not assigned a value in initialization code | Global variable is not assigned a value in the initialization section of program |
Non-initialized local variable | Local variable is not initialized before being read |
Non-initialized pointer | Pointer is not initialized before being read |
Non-initialized variable | Variable other than local variable is not initialized before being read |
Return value not initialized | C function does not return value when expected |
Unreachable code | Code cannot be reached during execution |
Topics
- Review and Fix Function Not Called Checks
Investigate why a function does not appear in the call graph starting from the
main
or another entry point. - Review and Fix Function Not Reachable Checks
Identify the call sites of a function and investigate why they occur in unreachable code.
- Review and Fix Return Value Not Initialized Checks
Identify paths through your function body that do not end in a
return
statement. - Review and Fix Non-initialized Local Variable Checks
Locate prior variable initializations if any and see if your program can bypass them.
- Review and Fix Non-initialized Pointer Checks
Locate prior pointer initializations if any and see if your program can bypass them.
- Review and Fix Non-initialized Variable Checks
Locate prior initializations of the global variable if any and see if your program can bypass them.
- Review and Fix Unreachable Code Checks
Investigate why a conditional statement in your code is redundant, for instance, always true or always false.
- Find Relations Between Variables in Code
Determine if the variables in any operation are related from some previous operation.