Skip to content

Commit 0d7d37f

Browse files
committed
Index expression should used signed_size_type rather than size_type
I based my code in the previous commit on this code, but then found it caused a type error. This leads me to believe that while this current code path may not be called in normal usage, it is in fact a latent bug. I believe this change is correct.
1 parent 7981e66 commit 0d7d37f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/analyses/variable-sensitivity/write_stack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ write_stackt::write_stackt(
3939
if(expr.type().id() == ID_array)
4040
{
4141
// We are assigning an array to a pointer, which is equivalent to assigning
42-
// the first element of that arary
42+
// the first element of that array
4343
// &(expr)[0]
4444
construct_stack_to_pointer(
45-
address_of_exprt(index_exprt(expr, from_integer(0, size_type()))),
45+
address_of_exprt(index_exprt(expr, from_integer(0, signed_size_type()))),
4646
environment,
4747
ns);
4848
}

0 commit comments

Comments
 (0)