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
b2f1c397
Commit
b2f1c397
authored
5 years ago
by
Thibault Martin
Committed by
Virgile Prevosto
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Retrait du paramètre optionel pour getRetVar
parent
16ef5e5e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_internals/typing/oneret.ml
+5
-5
5 additions, 5 deletions
src/kernel_internals/typing/oneret.ml
with
5 additions
and
5 deletions
src/kernel_internals/typing/oneret.ml
+
5
−
5
View file @
b2f1c397
...
...
@@ -197,7 +197,7 @@ let oneret ?(callback: callback option) (f: fundec) : unit =
let
lastloc
=
ref
Cil_datatype
.
Location
.
unknown
in
let
getRetVar
=
let
retVar
:
varinfo
option
ref
=
ref
None
in
fun
?
(
loc
=
Cil_datatype
.
Location
.
unknown
)
()
->
fun
loc
->
match
!
retVar
with
Some
rv
->
rv
|
None
->
begin
...
...
@@ -212,7 +212,7 @@ let oneret ?(callback: callback option) (f: fundec) : unit =
inherit
Cil
.
nopCilVisitor
method
!
vterm_lhost
=
function
|
TResult
_
->
let
v
=
getRetVar
()
in
let
v
=
getRetVar
Cil_datatype
.
Location
.
unknown
in
ChangeTo
(
TVar
(
cvar_to_lvar
v
))
|
TMem
_
|
TVar
_
->
DoChildren
end
...
...
@@ -268,7 +268,7 @@ let oneret ?(callback: callback option) (f: fundec) : unit =
(* Must create a statement *)
let
rv
=
if
hasRet
then
Some
(
new_exp
~
loc
(
Lval
(
Var
(
getRetVar
()
)
,
NoOffset
)))
Some
(
new_exp
~
loc
(
Lval
(
Var
(
getRetVar
loc
)
,
NoOffset
)))
else
None
in
mkStmt
(
Return
(
rv
,
loc
))
...
...
@@ -339,7 +339,7 @@ let oneret ?(callback: callback option) (f: fundec) : unit =
* an instruction that sets the return value (if any). *)
s
.
skind
<-
begin
match
retval
with
Some
rval
->
Instr
(
Set
((
Var
(
getRetVar
~
loc
()
)
,
NoOffset
)
,
rval
,
loc
))
Some
rval
->
Instr
(
Set
((
Var
(
getRetVar
loc
)
,
NoOffset
)
,
rval
,
loc
))
|
None
->
Instr
(
Skip
loc
)
end
;
let
returns_assert
=
ref
ptrue
in
...
...
@@ -348,7 +348,7 @@ let oneret ?(callback: callback option) (f: fundec) : unit =
returns_stack
;
(
match
retval
with
|
Some
_
->
let
lvar
=
Cil
.
cvar_to_lvar
(
getRetVar
()
)
in
let
lvar
=
Cil
.
cvar_to_lvar
(
getRetVar
loc
)
in
Stack
.
iter
(
fun
(
_
,_,
ca
)
->
adjust_assigns_clause
loc
lvar
ca
.
annot_content
)
returns_stack
...
...
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