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
22ca743c
Commit
22ca743c
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Fixes the compilation of the traces domain for the current trunk.
parent
fbdf2f8a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/value/domains/traces/traces_domain.ml
+12
-11
12 additions, 11 deletions
src/plugins/value/domains/traces/traces_domain.ml
with
12 additions
and
11 deletions
src/plugins/value/domains/traces/traces_domain.ml
+
12
−
11
View file @
22ca743c
...
@@ -703,15 +703,16 @@ module Traces = struct
...
@@ -703,15 +703,16 @@ module Traces = struct
let
add_loop
stmt
state
=
let
add_loop
stmt
state
=
let
(
n
,
g
)
=
get_current
state
in
let
(
n
,
g
)
=
get_current
state
in
let
succs
=
find_succs
n
g
in
let
succs
=
find_succs
n
g
in
let
same_loop
=
function
let
rec
find_same_loop
=
function
|
Loop
(
_
,
stmt'
,
s
,
last
)
when
Stmt
.
equal
stmt'
stmt
->
|
[]
->
Some
(
s
,
last
)
|
_
->
None
in
let
s
,
last
=
match
Extlib
.
find_opt
same_loop
succs
with
|
(
s
,
last
)
->
s
,
(
Graph
.
from_shape_id
last
)
|
exception
Not_found
->
Stmt
.
Hashtbl
.
memo
state
.
all_loop_start
stmt
(
fun
_
->
Node
.
next
()
,
Graph
.
empty
)
Stmt
.
Hashtbl
.
memo
state
.
all_loop_start
stmt
(
fun
_
->
Node
.
next
()
,
Graph
.
empty
)
|
edge
::
tl
->
match
edge
with
|
Loop
(
_
,
stmt'
,
s
,
last
)
when
Stmt
.
equal
stmt'
stmt
->
s
,
Graph
.
from_shape_id
last
|
_
->
find_same_loop
tl
in
in
let
s
,
last
=
find_same_loop
succs
in
let
current
=
OpenLoop
(
stmt
,
s
,
last
,
s
,
Graph
.
empty
,
state
.
current
)
in
let
current
=
OpenLoop
(
stmt
,
s
,
last
,
s
,
Graph
.
empty
,
state
.
current
)
in
{
state
with
current
}
{
state
with
current
}
...
@@ -1090,7 +1091,7 @@ end
...
@@ -1090,7 +1091,7 @@ end
let
dummy_loc
=
Location
.
unknown
let
dummy_loc
=
Location
.
unknown
let
subst_in_full
var_mapping
=
let
subst_in_full
var_mapping
=
let
visit
=
Cil
.
copy_visit
(
Project
.
current
()
)
in
let
visit
=
Visitor_behavior
.
copy
(
Project
.
current
()
)
in
visit
,
object
visit
,
object
inherit
Cil
.
genericCilVisitor
(
visit
)
inherit
Cil
.
genericCilVisitor
(
visit
)
method
!
vvrbl
vi
=
method
!
vvrbl
vi
=
...
@@ -1155,7 +1156,7 @@ let rec stmts_of_cfg cfg current var_map locals return_exp acc =
...
@@ -1155,7 +1156,7 @@ let rec stmts_of_cfg cfg current var_map locals return_exp acc =
let
exp
=
subst_in_exp
var_map
exp
in
let
exp
=
subst_in_exp
var_map
exp
in
let
predicate
=
(
Logic_utils
.
expr_to_predicate
~
cast
:
true
exp
)
.
Cil_types
.
ip_content
in
let
predicate
=
(
Logic_utils
.
expr_to_predicate
~
cast
:
true
exp
)
.
Cil_types
.
ip_content
in
let
predicate
=
if
b
then
predicate
else
Logic_const
.
pnot
predicate
in
let
predicate
=
if
b
then
predicate
else
Logic_const
.
pnot
predicate
in
let
code_annot
=
Logic_const
.
new_code_annotation
(
Cil_types
.
AAssert
([]
,
predicate
))
in
let
code_annot
=
Logic_const
.
new_code_annotation
(
Cil_types
.
AAssert
([]
,
Assert
,
predicate
))
in
let
stmt
=
Cil
.
mkStmtOneInstr
~
valid_sid
(
Cil_types
.
Code_annot
(
code_annot
,
dummy_loc
))
in
let
stmt
=
Cil
.
mkStmtOneInstr
~
valid_sid
(
Cil_types
.
Code_annot
(
code_annot
,
dummy_loc
))
in
stmts_of_cfg
cfg
n
var_map
locals
return_exp
(
stmt
::
acc
)
stmts_of_cfg
cfg
n
var_map
locals
return_exp
(
stmt
::
acc
)
...
@@ -1196,7 +1197,7 @@ let rec stmts_of_cfg cfg current var_map locals return_exp acc =
...
@@ -1196,7 +1197,7 @@ let rec stmts_of_cfg cfg current var_map locals return_exp acc =
let
exp
=
subst_in_exp
var_map
exp
in
let
exp
=
subst_in_exp
var_map
exp
in
let
exp
=
if
bloop
then
exp
else
Cil
.
new_exp
~
loc
:
dummy_loc
(
UnOp
(
LNot
,
exp
,
Cil
.
intType
))
in
let
exp
=
if
bloop
then
exp
else
Cil
.
new_exp
~
loc
:
dummy_loc
(
UnOp
(
LNot
,
exp
,
Cil
.
intType
))
in
let
body
=
stmts_of_cfg
g
nloop
var_map
locals
None
[]
in
let
body
=
stmts_of_cfg
g
nloop
var_map
locals
None
[]
in
let
acc
=
(
List
.
rev
(
Cil
.
mk
Whil
e
~
guard
:
exp
~
body
))
@
acc
in
let
acc
=
(
List
.
rev
(
Cil
.
mk
Loop
?
sattr
:
Non
e
~
guard
:
exp
~
body
))
@
acc
in
stmts_of_cfg
cfg
n2
var_map
locals
return_exp
acc
stmts_of_cfg
cfg
n2
var_map
locals
return_exp
acc
end
end
|
l
->
|
l
->
...
@@ -1230,7 +1231,7 @@ let project_of_cfg vreturn s =
...
@@ -1230,7 +1231,7 @@ let project_of_cfg vreturn s =
|
Cil_types
.
GFun
_
->
Cil
.
ChangeTo
([])
|
Cil_types
.
GFun
_
->
Cil
.
ChangeTo
([])
|
_
->
Cil
.
JustCopy
|
_
->
Cil
.
JustCopy
method
!
vfunc
fundec
=
method
!
vfunc
fundec
=
if
Varinfo
.
equal
(
Cil
.
g
et_orig
inal_
varinfo
self
#
behavior
fundec
.
Cil_types
.
svar
)
main
then
begin
if
Varinfo
.
equal
(
Visitor_behavior
.
G
et_orig
.
varinfo
self
#
behavior
fundec
.
Cil_types
.
svar
)
main
then
begin
(** copy of the fundec structure has already been done *)
(** copy of the fundec structure has already been done *)
fundec
.
slocals
<-
[]
;
fundec
.
slocals
<-
[]
;
let
var_map
=
Varinfo
.
Map
.
empty
in
let
var_map
=
Varinfo
.
Map
.
empty
in
...
...
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