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
8e18736e
Commit
8e18736e
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Eval_term: interprets logic coercions between integer and boolean types.
parent
d08808e7
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/plugins/value/legacy/eval_terms.ml
+10
-4
10 additions, 4 deletions
src/plugins/value/legacy/eval_terms.ml
with
10 additions
and
4 deletions
src/plugins/value/legacy/eval_terms.ml
+
10
−
4
View file @
8e18736e
...
...
@@ -899,7 +899,8 @@ let rec eval_term ~alarm_mode env t =
nothing to do, AND coercion from an integer type to a floating-point
type, that require a conversion. *)
(
match
Logic_const
.
plain_or_set
Extlib
.
id
ltyp
with
|
Linteger
when
Logic_typing
.
is_integral_type
t
.
term_type
->
r
|
Linteger
when
Logic_typing
.
is_integral_type
t
.
term_type
||
Logic_const
.
is_boolean_type
t
.
term_type
->
r
|
Ctype
typ
when
Cil
.
isIntegralOrPointerType
typ
->
r
|
Lreal
->
if
Logic_typing
.
is_integral_type
t
.
term_type
...
...
@@ -915,9 +916,14 @@ let rec eval_term ~alarm_mode env t =
ldeps
=
r
.
ldeps
;
eunder
=
under_from_over
eover
;
eover
;
}
|
_
->
unsupported
(
Format
.
asprintf
"logic coercion %a -> %a@."
Printer
.
pp_logic_type
t
.
term_type
Printer
.
pp_logic_type
ltyp
)
|
_
->
if
Logic_const
.
is_boolean_type
ltyp
&&
Logic_typing
.
is_integral_type
t
.
term_type
then
cast_to_bool
r
else
unsupported
(
Format
.
asprintf
"logic coercion %a -> %a@."
Printer
.
pp_logic_type
t
.
term_type
Printer
.
pp_logic_type
ltyp
)
)
(* TODO: the meaning of the label in \offset and \base_addr is not obvious
...
...
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