polyspace code prover: variable range does not change after function call
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A simmilar code like the following I'm checking with polyspace codeprover 2014b.
...
setAllToZero(myState);
x = myState->myVariable;
...
In the function setAllToZero() the variable myState->myVariable is set to 0. But after the function Call polyspace asumes, that the variable has full range. Why is the range not [0]. Or what I'm doing wrong?
Thanks
best regards
Johannes
0 commentaires
Réponses (2)
Lucas Lebert
le 8 Déc 2016
Since this post is quite old I assume that the issue has already been resolved. Nevertheless I want to leave tips for users who encounter the same issue. The first thing I would check is, whether the struct the pointer is pointing to is a global variable and if it is assigned to a permanent range. To check this just hover over "myVariable" in the third line of the example above. If the range is specified as "permanent range" in the tooltip. The first step is to investigate the "Variable/function range setup" in the "Inputs & Stubbing" pane of the Configurations. For the struct change the Init mode from "Permanent" to for example "Init".
If the struct the pointer is pointing to is not a global variable then it is a whole other story and I would need to have a closer look at it.
0 commentaires
Jan Kablitz
le 8 Mai 2017
Modifié(e) : Jan Kablitz
le 8 Mai 2017
I have the same Problem! It seems that Polyspace does not mentioned the connection between the pointer and the corresponding variable.
[EDIT] I'am working with 2017b
0 commentaires
Voir également
Catégories
En savoir plus sur Run Settings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!