From 27459c7010fbbb8fac36a910eabd72eafd5844fe Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 9 Apr 2024 00:43:27 +0900 Subject: [PATCH] updated hcl_makebigint() --- lib/obj.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/obj.c b/lib/obj.c index e7e86be..05fabe2 100644 --- a/lib/obj.c +++ b/lib/obj.c @@ -305,9 +305,13 @@ hcl_oop_t hcl_makebigint (hcl_t* hcl, int brand, const hcl_liw_t* ptr, hcl_oow_t #else # error UNSUPPORTED LIW BIT SIZE #endif - if (HCL_UNLIKELY(!oop)) return HCL_NULL; - - HCL_OBJ_SET_FLAGS_BRAND (oop, brand); + if (HCL_UNLIKELY(oop)) + { + hcl_oop_class_t _class = (brand == HCL_BRAND_PBIGINT)? + hcl->c_large_positive_integer: hcl->c_large_negative_integer; + HCL_OBJ_SET_FLAGS_BRAND (oop, brand); + HCL_OBJ_SET_CLASS (oop, (hcl_oop_t)_class); + } return oop; }