Skip to content

Commit

Permalink
CLEANUP: Avoid UBSAN error
Browse files Browse the repository at this point in the history
Test for arity > 0
  • Loading branch information
mgondan authored and JanWielemaker committed May 5, 2024
1 parent bcca31e commit b2311c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pl-comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1953,8 +1953,8 @@ left-to-right.
if ( flags & (SSU_COMMIT_CLAUSE|SSU_CHOICE_CLAUSE) )
Output_0(ci, I_CHP);

if ( head )
{ int n;
if ( head && ci->arity)
{ size_t n;
Word arg;

for ( arg = argTermP(*head, 0), n = 0; n < ci->arity; n++, arg++ )
Expand Down

0 comments on commit b2311c0

Please sign in to comment.