Skip to content

Commit

Permalink
Confusion, re issue #585
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 6, 2024
1 parent c168746 commit 33f2313
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bif_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ static bool bif_iso_asserta_1(query *q)
convert_to_literal(q->st.m, h);

if (!is_interned(h)) {
parser_destroy(p);
return throw_error(q, h, q->st.curr_frame, "type_error", "callable");
}

Expand Down Expand Up @@ -544,6 +545,7 @@ static bool bif_iso_assertz_1(query *q)
convert_to_literal(q->st.m, h);

if (!is_interned(h)) {
parser_destroy(p);
return throw_error(q, h, q->st.curr_frame, "type_error", "callable");
}

Expand Down Expand Up @@ -714,6 +716,7 @@ static bool do_assertz_2(query *q)
convert_to_literal(q->st.m, h);

if (!is_interned(h)) {
parser_destroy(p);
return throw_error(q, h, q->latest_ctx, "type_error", "callable");
}

Expand Down
9 changes: 9 additions & 0 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ void convert_to_literal(module *m, cell *c)
c->val_off = off;
c->match = NULL;
c->flags = 0;
c->arity = 0;
free(src);
}

Expand Down Expand Up @@ -1598,6 +1599,14 @@ static rule *assert_begin(module *m, unsigned nbr_vars, cell *p1, bool consultin
if (!is_check_directive(c)) {
c = get_head(p1);

#if 0
if (is_string(c)) {
if (consulting)
fprintf(stdout, "Error: not callable %s:(%s)/%u\n", m->name, C_STR(m, c), c->arity);
return NULL;
}
#endif

if ((c->val_off == g_neck_s) && (c->arity == 1)) {
if (consulting)
fprintf(stdout, "Error: permission error modifying %s:(%s)/%u\n", m->name, C_STR(m, c), c->arity);
Expand Down

0 comments on commit 33f2313

Please sign in to comment.