@@ -25,13 +25,6 @@ Author: Daniel Kroening
25
25
#include " structured_trace_util.h"
26
26
#include " xml_expr.h"
27
27
28
- bool full_lhs_value_includes_binary (
29
- const goto_trace_stept &step,
30
- const namespacet &ns)
31
- {
32
- return can_cast_type<floatbv_typet>(step.full_lhs_value .type ());
33
- }
34
-
35
28
xmlt full_lhs_value (const goto_trace_stept &step, const namespacet &ns)
36
29
{
37
30
xmlt full_lhs_value{" full_lhs_value" };
@@ -42,11 +35,16 @@ xmlt full_lhs_value(const goto_trace_stept &step, const namespacet &ns)
42
35
43
36
if (step.full_lhs_value .is_not_nil ())
44
37
full_lhs_value.data = from_expr (ns, identifier, step.full_lhs_value );
45
- if (full_lhs_value_includes_binary (step, ns))
38
+
39
+ if (
40
+ const auto &type =
41
+ type_try_dynamic_cast<bitvector_typet>(step.full_lhs_value .type ()))
46
42
{
47
- const auto width = to_floatbv_type (step.full_lhs_value .type ()).get_width ();
48
- const auto binary_representation = integer2binary (
49
- bvrep2integer (step.full_lhs_value .get (ID_value), width, false ), width);
43
+ const auto &constant =
44
+ expr_try_dynamic_cast<constant_exprt>(step.full_lhs_value );
45
+ const auto width = type->get_width ();
46
+ const auto binary_representation =
47
+ integer2binary (bvrep2integer (constant->get_value (), width, false ), width);
50
48
full_lhs_value.set_attribute (" binary" , binary_representation);
51
49
}
52
50
return full_lhs_value;
0 commit comments