Skip to content

Commit f12bf55

Browse files
committed
Dereferencing: we don't expect pointers into arrays with non-constant element size
Byte extracts could perhaps handle this and we would add those conditions to the `if` statement that follows, but it's not clear how we would arrive at such a situation.
1 parent d40b49b commit f12bf55

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/pointer-analysis/value_set_dereference.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,8 @@ value_set_dereferencet::valuet value_set_dereferencet::build_reference_to(
611611
// are we doing a byte?
612612
auto element_size =
613613
pointer_offset_size(to_array_type(root_object_type).element_type(), ns);
614-
615-
if(!element_size.has_value() || *element_size == 0)
616-
{
617-
throw "unknown or invalid type size of:\n" +
618-
to_array_type(root_object_type).element_type().pretty();
619-
}
614+
CHECK_RETURN(element_size.has_value());
615+
CHECK_RETURN(*element_size > 0);
620616

621617
const auto offset_int =
622618
numeric_cast_v<mp_integer>(to_constant_expr(offset));

0 commit comments

Comments
 (0)