File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed
regression/ansi-c/Issue_7104_Bv_Size Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 3
3
4
4
^EXIT=1$
5
5
^SIGNAL=0$
6
- only bitvectors of size multiple of 8 can be dereferenced
6
+ only bitvectors of size multiple of 8 bits can be dereferenced
7
7
^CONVERSION ERROR$
8
8
--
9
9
--
Original file line number Diff line number Diff line change @@ -1805,17 +1805,6 @@ void c_typecheck_baset::typecheck_expr_dereference(exprt &expr)
1805
1805
error () << " dereferencing void pointer" << eom;
1806
1806
throw 0 ;
1807
1807
}
1808
-
1809
- if (is_signed_or_unsigned_bitvector (expr.type ()))
1810
- {
1811
- auto bv_type_width = to_bitvector_type (expr.type ()).get_width ();
1812
- if (bv_type_width % 8 != 0 )
1813
- {
1814
- throw invalid_source_file_exceptiont{
1815
- " only bitvectors of size multiple of 8 can be dereferenced" ,
1816
- expr.source_location ()};
1817
- }
1818
- }
1819
1808
}
1820
1809
else
1821
1810
{
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ bvt boolbvt::convert_byte_extract(const byte_extract_exprt &expr)
40
40
}
41
41
42
42
const std::size_t width = boolbv_width (expr.type ());
43
+ if (width % 8 != 0 )
44
+ {
45
+ throw invalid_source_file_exceptiont{
46
+ " only bitvectors of size multiple of 8 bits can be dereferenced" ,
47
+ expr.source_location ()};
48
+ }
43
49
44
50
// special treatment for bit-fields and big-endian:
45
51
// we need byte granularity
You can’t perform that action at this time.
0 commit comments