Skip to content

GitLab

  • Menu
Projects Groups 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
    • Contributors
    • Graph
    • Compare
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • 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
  • #177
Closed
Open
Created Jun 13, 2017 by Kostyantyn Vorobyov@kvorobyovDeveloper

Incorrect handling of \initialized when initialized struct is passed to a function by value

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


Id Project Category View Due Date Updated
ID0002310 Frama-C Plug-in > E-ACSL public 2017-06-13 2019-01-25
Reporter kvorobyov Assigned To signoles Resolution open
Priority normal Severity minor Reproducibility always
Platform - OS - OS Version -
Product Version - Target Version - Fixed in Version -

Description :

This test case is derived from Toyota ITC benchmarks (File uninit_var.c, test case 012). Consider the following code:

struct S1 { int t; };

int foo(struct S1 s) { /*@assert \initialized(&s.t); */ if (s.t > 0) return 0; return 1; }

int main(int argc, const char **argv) { struct S1 s; s.t = 1; foo(s); return 0; }

Field t of struct S1 is initialized in main but when it is passed to foo (by value) it's a brand new block where field t is not marked as initialized. Consequently assertion in foo wrongly fails.

Attachments

  • itc-uninit-var-12.c
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking