File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed
regression/cbmc/havoc_slice_checks Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --full-slice
4+ ^\[main\.assertion\.\d+\] line 9 assertion havoc_slice W_OK.*: FAILURE$
5+ ^\[main\.assertion\.\d+\] line 13 assertion havoc_slice W_OK.*: FAILURE$
6+ ^\[main\.assertion\.\d+\] line 18 assertion havoc_slice W_OK.*: FAILURE$
7+ ^\[main\.assertion\.\d+\] line 21 assertion havoc_slice W_OK.*: FAILURE$
8+ ^\[main\.assertion\.\d+\] line 24 assertion havoc_slice W_OK.*: FAILURE$
9+ ^\[main\.assertion\.\d+\] line 27 assertion havoc_slice W_OK.*: FAILURE$
10+ ^\[main\.assertion\.\d+\] line 30 assertion havoc_slice W_OK.*: FAILURE$
11+ \*\* 7 of [0-9]+ failed \(.*\)
12+ ^VERIFICATION FAILED$
13+ ^EXIT=10$
14+ ^SIGNAL=0$
15+ --
Original file line number Diff line number Diff line change @@ -78,10 +78,20 @@ class range_spect
7878
7979 static range_spect to_range_spect (const mp_integer &size)
8080 {
81- PRECONDITION (size.is_long ());
81+ // The size need not fit into the analysis platform's width of a signed long
82+ // (as an example, it could be an unsigned size_t max, or perhaps the source
83+ // platform has much wider types than the analysis platform.
84+ if (!size.is_long ())
85+ return range_spect::unknown ();
86+
8287 mp_integer::llong_t ll = size.to_long ();
83- CHECK_RETURN (ll <= std::numeric_limits<range_spect::value_type>::max ());
84- CHECK_RETURN (ll >= std::numeric_limits<range_spect::value_type>::min ());
88+ if (
89+ ll > std::numeric_limits<range_spect::value_type>::max () ||
90+ ll < std::numeric_limits<range_spect::value_type>::min ())
91+ {
92+ return range_spect::unknown ();
93+ }
94+
8595 return range_spect{(value_type)ll};
8696 }
8797
You can’t perform that action at this time.
0 commit comments