Local Variable is calculated differently in the two runs
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi Matlab Support teams,
I'm using Polyspace R2019a, and i got a problem about local variable, which is calculated differently in the two runs
At version 1: At the line 1520, range value of local variable "u1t_InBitId" = [0...7]
Please take a look following pic 1:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/501508/image.png)
At version 2: Source code doesn't change in function, but range value of local variable "u1t_InBitId" = [0..199]
Please take a look following pic 2:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/501513/image.png)
We think the reason of this issue is wrong calculation of Code Prover
=> We added 3 lines of code as bellow:
At line 1522: #pragma Inspection_Point u1t_InIdCnv
At line 1523: #pragma Inspection_Point u1t_InCalcWork
At line 1525: #pragma Inspection_Point u1t_InBitId
This is the result after running Code Prover
Range value of local variable "u1t_InBitId" = [0..255]
Please take a look following pic 3:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/501518/image.png)
Why does "u1t_InBitId" change range value?
Please help me answer the question above.
댓글 수: 0
채택된 답변
Anirban
2021년 1월 29일
Hi,
There is usually a thread of logic behind the Code Prover calculation since Code Prover uses quite airtight mathematic. However, it is usually difficult to tell what is going on from a screenshot of just the problem location. If you contact Support through this link (https://www.mathworks.com/support/contact_us.html), they can help you much faster.
I can only make a guess. Your versions 1 and 2 do not seem identical. In your first picture, you show an expanded macro on line 1520 but in the second, the macro is collapsed. In the expanded macro, I can see a grey check right after the ? below the (. If this macro was collapsed, it should appear grey overall. However, in your second picture, the collapsed macro is green. Which indicates to me that something has changed between versions 1 and 2. Even if line 1520 itself has not changed, some line before has changed, which led to the grey check on line 1520 being removed in version 2.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Run Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!