Skip to content

Commit

Permalink
Fix for current_module/1, re issue #582
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 1, 2024
1 parent a5c9e2c commit 579d9b6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bif_predicates.c
Original file line number Diff line number Diff line change
Expand Up @@ -5648,8 +5648,7 @@ static bool bif_current_module_1(query *q)
}

check_heap_error(push_choice(q));

module *m = list_front(&q->pl->modules);
module *m = q->current_m = list_front(&q->pl->modules);
cell tmp;
make_atom(&tmp, new_atom(q->pl, m->name));
return unify(q, p1, p1_ctx, &tmp, q->st.curr_frame);
Expand All @@ -5658,7 +5657,7 @@ static bool bif_current_module_1(query *q)
if (!q->current_m)
return false;

module *m = list_next(q->current_m);
module *m = q->current_m = list_next(q->current_m);

if (!m)
return false;
Expand Down

0 comments on commit 579d9b6

Please sign in to comment.