Skip to content

Commit f62df2d

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Update src/goto-programs/goto_convert.cpp
1 parent 1a512c1 commit f62df2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/goto-programs/goto_convert.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,9 @@ bool goto_convertt::get_string_constant(
18341834
if(to_integer(to_constant_expr(*it), int_value))
18351835
return true;
18361836

1837-
unsigned long i = integer2ulong(int_value);
1837+
const auto i = numeric_cast<std::size_t>(*it);
1838+
if(!i.has_value())
1839+
return true;
18381840

18391841
if(i!=0) // to skip terminating 0
18401842
result+=static_cast<char>(i);

0 commit comments

Comments
 (0)