Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
251fe58c
Commit
251fe58c
authored
12 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[E-ACSL] fixed bug #1333 about handling of unsupported constructs occurring during pre-analysis
parent
582b7654
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/e-acsl/error.ml
+2
-2
2 additions, 2 deletions
src/plugins/e-acsl/error.ml
src/plugins/e-acsl/pre_analysis.ml
+29
-11
29 additions, 11 deletions
src/plugins/e-acsl/pre_analysis.ml
with
31 additions
and
13 deletions
src/plugins/e-acsl/error.ml
+
2
−
2
View file @
251fe58c
...
...
@@ -54,14 +54,14 @@ let generic_handle f res x =
with
|
Typing_error
s
->
let
msg
=
Format
.
sprintf
"@[invalid E-ACSL construct@ `%s'.@]"
s
in
Options
.
warning
~
current
:
true
"@[%s@ Ignoring annotation.@]"
msg
;
Options
.
warning
~
once
:
true
~
current
:
true
"@[%s@ Ignoring annotation.@]"
msg
;
Nb_typing
.
set
(
Nb_typing
.
get
()
+
1
);
res
|
Not_yet
s
->
let
msg
=
Format
.
sprintf
"@[E-ACSL construct@ `%s'@ is not yet supported.@]"
s
in
Options
.
warning
~
current
:
true
"@[%s@ Ignoring annotation.@]"
msg
;
Options
.
warning
~
once
:
true
~
current
:
true
"@[%s@ Ignoring annotation.@]"
msg
;
Nb_not_yet
.
set
(
Nb_not_yet
.
get
()
+
1
);
res
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/pre_analysis.ml
+
29
−
11
View file @
251fe58c
...
...
@@ -178,7 +178,7 @@ module rec Transfer
method
vpredicate
=
function
|
Pvalid
(
_
,
t
)
|
Pvalid_read
(
_
,
t
)
|
Pinitialized
(
_
,
t
)
|
Pallocable
(
_
,
t
)
|
Pfreeable
(
_
,
t
)
|
Pfresh
(
_
,
_
,
t
,
_
)
->
(* Options.feedback "REGISTER %a" Cil.d_term t;*)
(* Options.feedback "REGISTER %a" Cil.d_term t;*)
state_ref
:=
register_term
kf
!
state_ref
t
;
Cil
.
SkipChildren
|
Pseparated
_
->
Error
.
not_yet
"
\\
separated"
...
...
@@ -195,15 +195,15 @@ module rec Transfer
let
state
=
register_term
kf
!
state_ref
t1
in
state_ref
:=
register_term
kf
state
t2
;
Cil
.
SkipChildren
|
TConst
_
|
TSizeOf
_
|
TSizeOfStr
_
|
TAlignOf
_
|
Tnull
|
Ttype
_
|
Tempty_set
|
TSizeOfE
_
|
TUnOp
_
|
TBinOp
_
|
Ttypeof
_
->
(* no left-value inside inside: skip for efficiency *)
|
TConst
_
|
TSizeOf
_
|
TSizeOfStr
_
|
TAlignOf
_
|
Tnull
|
Ttype
_
|
Tempty_set
|
TSizeOfE
_
|
TUnOp
_
|
TBinOp
_
|
Ttypeof
_
->
(* no left-value inside inside: skip for efficiency *)
Cil
.
SkipChildren
|
TLval
_
|
TAlignOfE
_
|
TCastE
_
|
TAddrOf
_
|
TStartOf
_
|
Tapp
_
|
Tlambda
_
|
TDataCons
_
|
Tif
_
|
Tat
_
|
TCoerce
_
|
TCoerceE
_
|
TUpdate
_
|
Tunion
_
|
Tinter
_
|
Tcomprehension
_
|
Trange
_
|
Tlet
_
|
TLogic_coerce
_
->
(* potential sub-term inside *)
(* potential sub-term inside *)
Cil
.
DoChildren
method
vlogic_label
_
=
Cil
.
SkipChildren
method
vterm_lhost
=
function
...
...
@@ -216,12 +216,20 @@ module rec Transfer
let
register_predicate
kf
pred
state
=
let
state_ref
=
ref
state
in
ignore
(
Visitor
.
visitFramacIdPredicate
(
register_object
kf
state_ref
)
pred
);
Error
.
handle
(
fun
()
->
ignore
(
Visitor
.
visitFramacIdPredicate
(
register_object
kf
state_ref
)
pred
))
()
;
!
state_ref
let
register_code_annot
kf
a
state
=
let
state_ref
=
ref
state
in
ignore
(
Visitor
.
visitFramacCodeAnnotation
(
register_object
kf
state_ref
)
a
);
Error
.
handle
(
fun
()
->
ignore
(
Visitor
.
visitFramacCodeAnnotation
(
register_object
kf
state_ref
)
a
))
()
;
!
state_ref
(** The (backwards) transfer function for a branch. The [(Cil.CurrentLoc.get
...
...
@@ -398,7 +406,7 @@ end = struct
let
compute
init_set
kf
=
assert
(
not
(
Misc
.
is_library_loc
(
Kernel_function
.
get_location
kf
)));
let
tbl
=
Stmt
.
Hashtbl
.
create
17
in
(*
Options.feedback "ANALYSING %a" Kernel_function.pretty kf;*)
(*
Options.feedback "ANALYSING %a" Kernel_function.pretty kf;*)
Env
.
add
kf
tbl
;
try
let
init
=
object
...
...
@@ -449,8 +457,13 @@ let consolidated_must_model_vi ?kf vi =
(* TODO: should iterate in callgraph order *)
Globals
.
Functions
.
iter
(
fun
kf
->
let
set
=
Compute
.
get
kf
in
Env
.
consolidate
set
);
try
let
set
=
Compute
.
get
kf
in
Env
.
consolidate
set
with
exn
->
Kernel
.
fatal
"Pre-analysis failed for function %a:@
\n
%s"
Kernel_function
.
pretty
kf
(
Printexc
.
to_string
exn
));
(* Options.feedback "MUST MODEL %s? %b (consolidated)"
vi.vname (Env.consolidated_mem vi);*)
Env
.
consolidated_mem
vi
...
...
@@ -470,7 +483,12 @@ let must_model_vi ?kf ?stmt vi =
assert
false
|
Some
stmt
,
Some
kf
->
assert
(
Env
.
is_consolidated
()
);
let
tbl
=
try
Env
.
find
kf
with
Not_found
->
assert
false
in
let
tbl
=
try
Env
.
find
kf
with
Not_found
->
Options
.
fatal
"[Pre-analysis] unknown function %a"
Kernel_function
.
pretty
kf
in
try
let
set
=
Stmt
.
Hashtbl
.
find
tbl
stmt
in
Varinfo
.
Set
.
mem
vi
(
Env
.
default_varinfos
set
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment