why the orange warning for next line is not happened when array use just one index?

조회 수: 2 (최근 30일)
At line 1971, array ps2g_csain_KArInFarCorIndirElimDistFr uses index u1s_csain_EmBumpTypeIndex, Orange warning is happened.
Size ps2g_csain_KArInFarCorIndirElimDistFr = 4
Range value of u1s_csain_EmBumpTypeIndex= [0..9]
Line 1791 and col 84 are orange warning. Please take a look Pic below:
Sequence Flow cod leads to warning: Please take a look Pic below:
At line 1973, array ps2g_csain_KArInFarCorIndirElimDistRr uses index u1s_csain_EmBumpTypeIndex, Green warning is happened.
Size ps2g_csain_KArInFarCorIndirElimDistRr = 4
Range value of u1s_csain_EmBumpTypeIndex= [0..3]
Line 1793 and col 84 are Green warning. Please take a look Pic below:
At line 1791Range value of u1s_csain_EmBumpTypeIndex = [0..9]. u1s_csain_EmBumpTypeIndex is not assigned from 1791 to 1793.
Please let me know why Range value of u1s_csain_EmBumpTypeIndex at line 1793 = [0..3]
BR
Thang Tran
  댓글 수: 1
Tran Thang
Tran Thang 2021년 7월 29일
I have tried a checking. I creased size of ps2g_csain_KArInFarCorIndirElimDistFr from 4 to 10. And color of at line 1791 becomes GREEN
Please take a look picture below:
But color at line 1793 become ORANGE
At line 1793 Range value of u1s_csain_EmBumpTypeIndex = [0..9].
u1s_csain_EmBumpTypeIndex is not assigned from 1793 to 1794.
Please let me know why Range value of u1s_csain_EmBumpTypeIndex at line 1794 = [0..3]
I think that u1s_csain_EmBumpTypeIndex at line 1794 should be = [0..9]
BR
Thang Tran

댓글을 달려면 로그인하십시오.

채택된 답변

Anirban
Anirban 2021년 7월 29일
편집: Anirban 2021년 7월 29일
Hi,
Following an orange check, the analysis eliminates execution paths that lead to an error. This is intended to save you from reviewing many, many orange checks from the exact same root cause. That is why, in the line after the orange Out of bounds array index, the analysis only considers execution paths where the array index is within bounds.

추가 답변 (0개)

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by