- 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
1 次查看(过去 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 中查找有关 Code Prover Analysis in Polyspace Platform User Interface 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!