From d31735ed3e652e8bd52feec7807902ace8e5fe37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Wed, 22 Nov 2023 13:41:12 +0100 Subject: [PATCH] core: argument checking in si:get-limit and si:set-limit Previously we've falled through all cases and if none matched, we've used the heap. That said our documentation clearly states, that the type for the heap is EXT:HEAP-SIZE. --- src/c/stacks.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/c/stacks.d b/src/c/stacks.d index 7cefe8cf3..71bf88c5d 100644 --- a/src/c/stacks.d +++ b/src/c/stacks.d @@ -807,7 +807,7 @@ si_set_limit(cl_object type, cl_object limit) } else if (type == @'ext::lisp-stack') { cl_index the_size = ecl_to_size(limit); ecl_stack_set_size(env, the_size); - } else { + } else if (type == @'ext::heap-size') { /* * size_t can be larger than cl_index, and ecl_to_size() * creates a fixnum which is too small for size_t on 32-bit. @@ -823,7 +823,7 @@ cl_object si_get_limit(cl_object type) { cl_env_ptr env = ecl_process_env(); - cl_index output; + cl_index output = 0; if (type == @'ext::frame-stack') output = env->frs_limit_size; else if (type == @'ext::binding-stack') @@ -832,7 +832,7 @@ si_get_limit(cl_object type) output = env->cs_limit_size; else if (type == @'ext::lisp-stack') output = env->stack_limit_size; - else { + else if (type == @'ext::heap-size') { /* size_t can be larger than cl_index */ ecl_return1(env, ecl_make_unsigned_integer(cl_core.max_heap_size)); }