From 72e6b66b1c9699cef63922c988c40031a5fc5925 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 6 May 2024 23:53:47 +0100 Subject: [PATCH] declare the last arg to GAP_CallFunc3Args volatile This appears to fix #37026 --- src/sage/libs/gap/element.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx index f1482997b86..7ca4a666abc 100644 --- a/src/sage/libs/gap/element.pyx +++ b/src/sage/libs/gap/element.pyx @@ -2504,6 +2504,7 @@ cdef class GapElement_Function(GapElement): cdef Obj result = NULL cdef Obj arg_list cdef int n = len(args) + cdef volatile Obj v2 if n > 0 and n <= 3: libgap = self.parent() @@ -2522,10 +2523,11 @@ cdef class GapElement_Function(GapElement): (a[0]).value, (a[1]).value) elif n == 3: + v2 = (a[2]).value result = GAP_CallFunc3Args(self.value, (a[0]).value, (a[1]).value, - (a[2]).value) + v2) else: arg_list = make_gap_list(args) result = GAP_CallFuncList(self.value, arg_list)