- If a function call is not reachable at run-time, it is not taken into account.
- If there is a red-check (definite run-time error), the analysis does not compute the stack size. The idea is: definite run-time errors would typically cause a crash anyway, so function calls following the errors wont be executed anyway. Hence, the errors need to be fixed.
Stack check by Code Prover
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all,
My first post here...
We are working on an embedded project, bare metal. The customer asks for a analysis of the stack and suggests using static analysis tool. We have Code Prover and we know it can do this stack check, but we are not in need at the moment to perform a whole Code Prover analysis. Can we request Code Prover to execute just the stack check? By removing all of the code prover checks, I'm in the hope of getting fewer reds if none at all and having the info I need more easily and faster.
Thanks
댓글 수: 0
채택된 답변
Anirban
2021년 2월 3일
편집: Anirban
2021년 2월 3일
It is possible to calculate all code metrics other than stack size in the earlier stages of a Code Prover analysis. You have to enable the option Calculate code metrics and set the option Verification level to Source Compliance Checking.
The stack analysis actually computes an accurate picture of the function call hierarchy taking into account red checks (run-time errors) and gray checks (unreachable code). In other words:
Because of this reason, the stack size computation happens in the later part of the analysis. This computation is richer than a superficial stack size computation that would be based on the apparent function call hierarchy without checking if the calls actually can happen at run-time.
As a result, you cannot separate the run-time error detection from the stack size computation. In other words, you cannot just perform the early stages of the analysis and get the stack size.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Check Behavior에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!