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
7bcd5e3b
Commit
7bcd5e3b
authored
9 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
[Instrumentation engine] Indentation
parent
1f4513f1
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/e-acsl/visit.ml
+28
-28
28 additions, 28 deletions
src/plugins/e-acsl/visit.ml
with
28 additions
and
28 deletions
src/plugins/e-acsl/visit.ml
+
28
−
28
View file @
7bcd5e3b
...
...
@@ -273,34 +273,34 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
let
build_mmodel_initializer
()
=
let
loc
=
Location
.
unknown
in
match
main_fct
with
|
Some
main
->
let
charPtrPtrType
=
TPtr
(
Cil
.
charPtrType
,
[]
)
in
let
ptrSz
=
(
Cil
.
sizeOf
loc
Cil
.
voidPtrType
)
in
let
args
=
(* Record arguments only if the first one has int type and the
second one is an array of char pointers of equivalent. This is
sufficient to capture C99 compliant arguments and GCC extensions
with environ. *)
match
main
.
sformals
with
|
vi1
::
vi2
::
_
when
vi1
.
vtype
=
Cil
.
intType
&&
vi2
.
vtype
=
charPtrPtrType
->
(* Add a call to __init_args if need argv for analysis *)
if
Mmodel_analysis
.
must_model_vi
vi2
then
begin
let
arg
=
[
Cil
.
evar
vi1
;
Cil
.
evar
vi2
]
in
let
arginit
=
Misc
.
mk_call
loc
"__init_argv"
arg
in
main
.
sbody
.
bstmts
<-
arginit
::
main
.
sbody
.
bstmts
;
end
;
(* Grab addresses of arguments for a call to the main
initialization function, i.e., [__e_acsl_memory_init] *)
List
.
map
Cil
.
mkAddrOfVi
main
.
sformals
;
|
_
->
let
null
=
Cil
.
zero
loc
in
[
null
;
null
]
in
let
args
=
args
@
[
ptrSz
]
in
let
init
=
Misc
.
mk_call
Location
.
unknown
"__e_acsl_memory_init"
args
in
main
.
sbody
.
bstmts
<-
init
::
main
.
sbody
.
bstmts
;
()
|
None
->
()
|
Some
main
->
let
charPtrPtrType
=
TPtr
(
Cil
.
charPtrType
,
[]
)
in
let
ptrSz
=
(
Cil
.
sizeOf
loc
Cil
.
voidPtrType
)
in
let
args
=
(* Record arguments only if the first one has int type and the
second one is an array of char pointers of equivalent. This is
sufficient to capture C99 compliant arguments and GCC extensions
with environ. *)
match
main
.
sformals
with
|
vi1
::
vi2
::
_
when
vi1
.
vtype
=
Cil
.
intType
&&
vi2
.
vtype
=
charPtrPtrType
->
(* Add a call to __init_args if need argv for analysis *)
if
Mmodel_analysis
.
must_model_vi
vi2
then
begin
let
arg
=
[
Cil
.
evar
vi1
;
Cil
.
evar
vi2
]
in
let
arginit
=
Misc
.
mk_call
loc
"__init_argv"
arg
in
main
.
sbody
.
bstmts
<-
arginit
::
main
.
sbody
.
bstmts
;
end
;
(* Grab addresses of arguments for a call to the main
initialization function, i.e., [__e_acsl_memory_init] *)
List
.
map
Cil
.
mkAddrOfVi
main
.
sformals
;
|
_
->
let
null
=
Cil
.
zero
loc
in
[
null
;
null
]
in
let
args
=
args
@
[
ptrSz
]
in
let
init
=
Misc
.
mk_call
loc
"__e_acsl_memory_init"
args
in
main
.
sbody
.
bstmts
<-
init
::
main
.
sbody
.
bstmts
;
()
|
None
->
()
in
if
Mmodel_analysis
.
use_model
()
then
Project
.
on
prj
build_mmodel_initializer
()
;
(* reset copied states at the end to be observationally
...
...
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