From 371ddc48be3b3533a381bc3eb7e5dead87a30c4e Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 9 Feb 2023 10:59:11 +0900 Subject: [PATCH] Backport fix --- src/obj_long.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/obj_long.c b/src/obj_long.c index 74f6608..cc5e54a 100644 --- a/src/obj_long.c +++ b/src/obj_long.c @@ -398,7 +398,9 @@ static int krk_long_add(KrkLong * res, const KrkLong * a, const KrkLong * b) { FINISH_OUTPUT(res); return 0; } - return 1; + krk_long_clear(res); + FINISH_OUTPUT(res); + return 0; } else if (a->width > 0 && b->width < 0) { switch (krk_long_compare_abs(a,b)) { case -1: @@ -412,8 +414,9 @@ static int krk_long_add(KrkLong * res, const KrkLong * a, const KrkLong * b) { FINISH_OUTPUT(res); return 0; } + krk_long_clear(res); FINISH_OUTPUT(res); - return 1; + return 0; } /* sign must match for this, so take it from whichever */