From: Mark Thom Date: Tue, 1 Feb 2022 01:08:00 +0000 (-0700) Subject: tag length/2 as the source of finite_memory errors in list.pl (#1259) X-Git-Tag: v0.9.0^2~36 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=e62875ac904d78dd5a358bf47aad9f8b31202cb4;p=scryer-prolog.git tag length/2 as the source of finite_memory errors in list.pl (#1259) --- diff --git a/src/lib/lists.pl b/src/lib/lists.pl index f5a62edb..22ee8d4b 100644 --- a/src/lib/lists.pl +++ b/src/lib/lists.pl @@ -54,9 +54,9 @@ length(Xs0, N) :- '$skip_max_list'(M, N, Xs0,Xs), !, ( Xs == [] -> N = M - ; nonvar(Xs) -> var(N), throw(error(resource_error(finite_memory),_)) + ; nonvar(Xs) -> var(N), throw(error(resource_error(finite_memory),length/2)) ; nonvar(N) -> R is N-M, length_rundown(Xs, R) - ; N == Xs -> throw(error(resource_error(finite_memory),_)) + ; N == Xs -> throw(error(resource_error(finite_memory),length/2)) ; length_addendum(Xs, N, M) ). length(_, N) :-