Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F frama-c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 168
    • Issues 168
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #670
Closed
Open
Issue created Feb 09, 2015 by Jochen Burghardt@burghardt

value analysis assumes dynamic_cast between unrelated classes to succeed, rather than to yield NULL

ID0002076: This issue was created automatically from Mantis Issue 2076. Further discussion may take place here.


Id Project Category View Due Date Updated
ID0002076 Frama-Clang Plug-in > clang public 2015-02-09 2015-04-01
Reporter Jochen Assigned To virgile Resolution open
Priority normal Severity minor Reproducibility always
Platform Neon-20140301+dev-STANCE-Jan2015 OS - OS Version xubuntu-cfe13.10
Product Version - Target Version - Fixed in Version -

Description :

Running "frama-c -val 461.cpp" on the attached program yields the output (excerpt):

461.cpp:10:[value] Assertion got status valid.

However, running "clang++ 461.cpp && ./a.out" reveals that the assertion in line 12 (identical to that in line 11) is in fact invalid:

a.out: 461.cpp:11: int main(): Assertion `bp!=0' failed.

Compiling "g++ 461.cpp" even yields a compile-time warning:

461.cpp: In function ‘int main()’: 461.cpp:9:37: warning: dynamic_cast of ‘A aaa’ to ‘struct B*’ can never succeed [enabled by default] B* const bp = dynamic_cast<B*>(&aaa); ^

Attachments

  • 461.cpp
  • 461_bis.cpp
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking