Main Content
Invalid assumptions about memory organization
Address is computed by adding or subtracting from address of a variable
Description
This defect occurs when you compute the address of a variable in the stack by adding or subtracting from the address of another non-array variable.
Risk
When you compute the address of a variable in the stack by adding or subtracting from the address of another variable, you assume a certain memory organization. If your assumption is incorrect, accessing the computed address can be invalid.
Fix
Do not perform an access that relies on assumptions about memory organization.
Examples
Result Information
Group: Programming |
Language: C | C++ |
Default: On for handwritten code, off for generated code |
Command-Line Syntax: INVALID_MEMORY_ASSUMPTION |
Impact: Medium |
Version History
Introduced in R2015b
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)