Detect Division by Zero
Check ID:
mathworks.sldv.divbyzero
Detects division-by-zero errors in your model
Description
This check identifies operations in your model that cause division-by-zero errors.
Following the recommendations of this check increases the likelihood of generating MISRA C:2012 compliant code for embedded applications, as well as code that complies with the CERT C, CWE, ISO/IEC TS 17961 standards.
Results and Recommended Actions
Result | Recommended Action |
---|---|
Failed, model incompatible | Resolve the model incompatibility. See
Also see Handle Incompatibilities with Automatic Stubbing (Simulink Design Verifier). |
Division by zero found in model | To view the conditions that cause the division by zero, create a harness model. When you simulate the harness, the inputs replicate the error. Click View test case in the Model Advisor report. |
Capabilities and Limitations
Does not run on library models.
Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to
all
.Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to
on
.Does not support exclusions.
See Also
MISRA C:2012: Directive 4.1
ISO/IEC TS 17961: 2013, diverr
CERT C, INT33-C and FLP03-C
CWE, CWE-369
Secure Coding (Embedded Coder)
Detect and Address Bugs (Simulink Design Verifier)
Detect Integer Overflow and Division-by-Zero Errors (Simulink Design Verifier)