Skip to content

Commit b65ff54

Browse files
committed
WIP, re issue #893
1 parent aad5c03 commit b65ff54

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/terms.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ static void collect_var_lists(query *q, cell *p1, pl_ctx p1_ctx, unsigned depth)
8989

9090
static void collect_vars_internal(query *q, cell *p1, pl_ctx p1_ctx, unsigned depth)
9191
{
92+
if (depth > g_max_depth) {
93+
//printf("*** OOPS %s %d\n", __FILE__, __LINE__);
94+
return;
95+
}
96+
9297
if (is_var(p1)) {
9398
if (!(p1->flags & FLAG_VAR_CYCLIC))
9499
accum_var(q, p1, p1_ctx);
@@ -184,6 +189,11 @@ static bool has_vars_lists(query *q, cell *p1, pl_ctx p1_ctx, unsigned depth)
184189

185190
static bool has_vars_internal(query *q, cell *p1, pl_ctx p1_ctx, unsigned depth)
186191
{
192+
if (depth > g_max_depth) {
193+
//printf("*** OOPS %s %d\n", __FILE__, __LINE__);
194+
return true;
195+
}
196+
187197
if (is_var(p1))
188198
return true;
189199

0 commit comments

Comments
 (0)