MATLAB Answers

Number of Illegally dereferenced pointer on version R2020b is decreased significantly?

1 view (last 30 days)
Tran Thang
Tran Thang on 18 Mar 2021
Commented: Anirban on 30 Apr 2021
I'm comparing between version R2019b and R2020b when run same source code. Please take a look two shoots below:
  • Source 780B
  • Source 800B
Run 780B*: Number of Illegally dereferenced pointer on version R2020b is decreased to 264
Run 800B: Illegally dereferenced pointer on version R2020b is decreased to 237
Please let me know why Number of Illegally dereferenced pointer on version R2020b is decreased significantly?
Should we apply version R2020b?
BR
Thang Tran
  1 Comment
Rik
Rik on 18 Mar 2021
If you want anyone else to have a shot at answering this question, you will have to provide a lot more explanation. Have a read here and here.

Sign in to comment.

Answers (1)

Anirban
Anirban on 19 Mar 2021
Hi,
I assume you are using the exact same Polyspace project (with exact same configuration) in both versions. Can you check something real quick? Assuming that you are using the desktop products, on the Dashboard pane for a project, you can see the percentage of code covered by the verification. See more details in Dashboard. Can you check if the coverage is the same in both versions?
  10 Comments
Anirban
Anirban on 30 Apr 2021
Hi,
In both releases, the message states that the pointer is not null. So that is not the difference.
An Illegally dereferenced pointer check consists of several checks:
  • Whether the pointer is NULL.
  • Whether the pointer points to a region that is ok to dereference.
It's the second check where R2019a and R2020b seems to differ. An interesting difference I notice is that in R2019a, the message states these things:
  • Pointer may point to dynamically allocated memory. Is the pointer really pointing to dynamically allocated memory? Or, maybe Polyspace thinks it is doing that because of some overapproximation? And maybe Polyspace is more precise in R202b?
  • Pointer points to some local variable in a function and is accessed outside the function. Again, this might be an overapproximation, that became more precise in R2020b.
I hope you were able to contact Support, and get a detailed investigation on your project.

Sign in to comment.

Tags

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by