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
0d00f5d4
Commit
0d00f5d4
authored
3 years ago
by
Basile Desloges
Browse files
Options
Downloads
Patches
Plain Diff
[eacsl] Use the `vorig_name` of a function when checking for replacements
parent
f5cfd9b3
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/src/code_generator/injector.ml
+5
-3
5 additions, 3 deletions
src/plugins/e-acsl/src/code_generator/injector.ml
src/plugins/e-acsl/src/project_initializer/rtl.ml
+1
-1
1 addition, 1 deletion
src/plugins/e-acsl/src/project_initializer/rtl.ml
with
6 additions
and
4 deletions
src/plugins/e-acsl/src/code_generator/injector.ml
+
5
−
3
View file @
0d00f5d4
...
@@ -49,20 +49,22 @@ let replace_literal_strings_in_args env kf_opt (* None for globals *) args =
...
@@ -49,20 +49,22 @@ let replace_literal_strings_in_args env kf_opt (* None for globals *) args =
RTL. *)
RTL. *)
let
rename_caller
~
loc
caller
args
=
let
rename_caller
~
loc
caller
args
=
if
Options
.
Replace_libc_functions
.
get
()
if
Options
.
Replace_libc_functions
.
get
()
&&
Functions
.
RTL
.
has_rtl_replacement
caller
.
vname
then
begin
&&
Functions
.
RTL
.
has_rtl_replacement
caller
.
v
orig_
name
then
begin
(* rewrite names of functions for which we have alternative definitions in
(* rewrite names of functions for which we have alternative definitions in
the RTL. *)
the RTL. *)
let
fvi
=
Rtl
.
Symbols
.
libc_replacement
caller
in
let
fvi
=
Rtl
.
Symbols
.
libc_replacement
caller
in
fvi
,
args
fvi
,
args
end
end
else
if
Options
.
Validate_format_strings
.
get
()
else
if
Options
.
Validate_format_strings
.
get
()
&&
Functions
.
Libc
.
is_printf_name
caller
.
vname
then
&&
Functions
.
Libc
.
is_printf_name
caller
.
v
orig_
name
then
(* rewrite names of format functions (such as printf). This case differs
(* rewrite names of format functions (such as printf). This case differs
from the above because argument list of format functions is extended with
from the above because argument list of format functions is extended with
an argument describing actual variadic arguments *)
an argument describing actual variadic arguments *)
(* replacement name, e.g., [printf] -> [__e_acsl_builtin_printf] *)
(* replacement name, e.g., [printf] -> [__e_acsl_builtin_printf] *)
let
fvi
=
Rtl
.
Symbols
.
libc_replacement
caller
in
let
fvi
=
Rtl
.
Symbols
.
libc_replacement
caller
in
let
fmt
=
Functions
.
Libc
.
get_printf_argument_str
~
loc
caller
.
vname
args
in
let
fmt
=
Functions
.
Libc
.
get_printf_argument_str
~
loc
caller
.
vorig_name
args
in
fvi
,
fmt
::
args
fvi
,
fmt
::
args
else
else
caller
,
args
caller
,
args
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/src/project_initializer/rtl.ml
+
1
−
1
View file @
0d00f5d4
...
@@ -79,7 +79,7 @@ end = struct
...
@@ -79,7 +79,7 @@ end = struct
with
Not_found
->
raise
(
Unregistered
s
)
with
Not_found
->
raise
(
Unregistered
s
)
let
libc_replacement
fvi
=
let
libc_replacement
fvi
=
let
name
=
Functions
.
RTL
.
libc_replacement_name
fvi
.
vname
in
let
name
=
Functions
.
RTL
.
libc_replacement_name
fvi
.
v
orig_
name
in
try
try
find_vi
name
find_vi
name
with
Unregistered
_
->
with
Unregistered
_
->
...
...
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