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)