Skip to content

Commit c0eaab5

Browse files
committed
Avoid signed/unsigned casts and conversion in goto_inline
1 parent 53baae6 commit c0eaab5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/goto-programs/goto_inline_class.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ bool goto_inlinet::check_inline_map(
700700
if(call_list.empty())
701701
return true;
702702

703-
int ln=-1;
703+
unsigned ln = goto_programt::instructiont::nil_target;
704704

705705
for(const auto &call : call_list)
706706
{
@@ -713,8 +713,12 @@ bool goto_inlinet::check_inline_map(
713713
#endif
714714

715715
// location numbers increasing
716-
if(static_cast<int>(target->location_number)<=ln)
716+
if(
717+
ln != goto_programt::instructiont::nil_target &&
718+
target->location_number <= ln)
719+
{
717720
return false;
721+
}
718722

719723
if(!target->is_function_call())
720724
return false;

0 commit comments

Comments
 (0)