Code Prover warning 'Illegally dereferenced pointer'
Show older comments
While running the code prover i got same Orange warning on many places in the code. For example in the function,
void DD_XYZ_Init( uint32_t addr_mcs_crit_ctrl )
{
( ( *((uint32_t volatile *)((uint32_t)addr_tim_crit_ctrl + ( (uint32_t)((uint32_t)0xf0100000+0x00001024) - (uint32_t)((uint32_t)0xf0100000+0x00001024) ))) ) ) = 0;
}
The Warning that i got,
Illegally dereferenced pointer
Warning: pointer may be outside its bounds
Dereference of expression (pointer to volatile unsigned int 32, size: 32 bits):
Pointer may be null.
Points to 4 bytes at unknown offset in buffer of unknown size, so may be outside bounds.
Pointer may point to dynamically allocated memory.
My Question,
We have given proper range for ‘addr_tim_crit_ctrl’ in constraint specification file, but still getting the warning. What could be the reason?
2 Comments
Anirban
on 5 May 2021
Can you state what you provided as constraint on addr_tim_crit_ctrl ? The input to the function seems to be addr_mcs_crit_ctrl . Is it a typo or is addr_tim_crit_ctrl actually different from addr_mcs_crit_ctrl?
Nideesh Madhu
on 5 May 2021
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Polyspace Code Prover in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!