@@ -25,67 +25,6 @@ class flatten_byte_extract_exceptiont : public std::runtime_error
2525 }
2626};
2727
28- class non_const_array_sizet : public flatten_byte_extract_exceptiont
29- {
30- public:
31- non_const_array_sizet (const typet &array_type, const exprt &max_bytes)
32- : flatten_byte_extract_exceptiont(" cannot unpack array of non-const size" ),
33- max_bytes (max_bytes),
34- array_type(array_type)
35- {
36- std::ostringstream error_message;
37- error_message << runtime_error::what () << " \n " ;
38- error_message << " array_type: " << array_type.pretty ();
39- error_message << " \n max_bytes: " << max_bytes.pretty ();
40- computed_error_message = error_message.str ();
41- }
42-
43- const char *what () const optional_noexcept override
44- {
45- return computed_error_message.c_str ();
46- }
47-
48- private:
49- exprt max_bytes;
50- typet array_type;
51-
52- std::string computed_error_message;
53- };
54-
55- class non_byte_alignedt : public flatten_byte_extract_exceptiont
56- {
57- public:
58- non_byte_alignedt (
59- const struct_typet &struct_type,
60- const struct_union_typet::componentt &component,
61- const mp_integer &byte_width)
62- : flatten_byte_extract_exceptiont(
63- " cannot unpack struct with non-byte aligned components" ),
64- struct_type (struct_type),
65- component(component),
66- byte_width(byte_width)
67- {
68- std::ostringstream error_message;
69- error_message << runtime_error::what () << " \n " ;
70- error_message << " width: " << byte_width << " \n " ;
71- error_message << " component:" << component.get_name () << " \n " ;
72- error_message << " struct_type: " << struct_type.pretty ();
73- computed_error_message = error_message.str ();
74- }
75-
76- const char *what () const optional_noexcept override
77- {
78- return computed_error_message.c_str ();
79- }
80-
81- private:
82- const struct_typet struct_type;
83- const struct_union_typet::componentt component;
84- const mp_integer byte_width;
85-
86- std::string computed_error_message;
87- };
88-
8928class non_constant_widtht : public flatten_byte_extract_exceptiont
9029{
9130public:
0 commit comments