Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
frama-c
Commits
b1eb3c67
Commit
b1eb3c67
authored
Aug 27, 2019
by
Julien Signoles
Browse files
code factorization
parent
c1ffa08a
Changes
1
Show whitespace changes
Inline
Side-by-side
src/plugins/e-acsl/gmp.ml
View file @
b1eb3c67
...
@@ -149,8 +149,8 @@ let get_set_suffix_and_arg e =
...
@@ -149,8 +149,8 @@ let get_set_suffix_and_arg e =
|
TFloat
((
FDouble
|
FFloat
)
,
_
)
->
|
TFloat
((
FDouble
|
FFloat
)
,
_
)
->
(* FFloat is a strict subset of FDouble (modulo exceptional numbers)
(* FFloat is a strict subset of FDouble (modulo exceptional numbers)
Hence, calling [set_d] for both of them is sound.
Hence, calling [set_d] for both of them is sound.
HOWEVER: the machdep MUST NOT be vulnerable to double rounding
*)
HOWEVER: the machdep MUST NOT be vulnerable to double rounding
(* TODO RATIONAL: check machdep
*)
[TODO] check the statement above
*)
"_d"
,
[
e
]
"_d"
,
[
e
]
|
TFloat
(
FLongDouble
,
_
)
->
|
TFloat
(
FLongDouble
,
_
)
->
Error
.
not_yet
"creating gmp from long double"
Error
.
not_yet
"creating gmp from long double"
...
@@ -159,19 +159,7 @@ let get_set_suffix_and_arg e =
...
@@ -159,19 +159,7 @@ let get_set_suffix_and_arg e =
let
generic_affect
~
loc
fname
lv
ev
e
=
let
generic_affect
~
loc
fname
lv
ev
e
=
let
ty
=
Cil
.
typeOf
ev
in
let
ty
=
Cil
.
typeOf
ev
in
if
Z
.
is_t
ty
then
begin
if
Z
.
is_t
ty
||
Q
.
is_t
ty
then
begin
assert
(* Missing cast/wrong typing happened in the past *)
(
not
(
Q
.
is_t
(
Cil
.
typeOf
e
)));
let
suf
,
args
=
get_set_suffix_and_arg
e
in
Misc
.
mk_call
~
loc
(
fname
^
suf
)
(
ev
::
args
)
end
else
if
Q
.
is_t
ty
then
begin
assert
(* Missing cast/wrong typing happened in the past *)
(
not
(
Z
.
is_t
(
Cil
.
typeOf
e
)));
(* TODO RATIONAL: [from Fonenantsoa:]
If we try to factorize the following the above
then the result is different... why ?! *)
let
suf
,
args
=
get_set_suffix_and_arg
e
in
let
suf
,
args
=
get_set_suffix_and_arg
e
in
Misc
.
mk_call
~
loc
(
fname
^
suf
)
(
ev
::
args
)
Misc
.
mk_call
~
loc
(
fname
^
suf
)
(
ev
::
args
)
end
else
end
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment