Skip to content

Commit a2c88a6

Browse files
author
Release Manager
committed
gh-37951: declare the last arg to GAP_CallFunc3Args volatile This appears to fix #37026 (segfaults in src/sage/libs/gap/element.pyx with Python 3.12 and gcc 13.2.1) See also #36407 (comment) The corresponding gcc 13.2.1's bug (or feature) is being dealt with here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114872 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #37951 Reported by: Dima Pasechnik Reviewer(s): Dima Pasechnik, Gonzalo Tornaría
2 parents b2c3894 + 72e6b66 commit a2c88a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sage/libs/gap/element.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2504,6 +2504,7 @@ cdef class GapElement_Function(GapElement):
25042504
cdef Obj result = NULL
25052505
cdef Obj arg_list
25062506
cdef int n = len(args)
2507+
cdef volatile Obj v2
25072508

25082509
if n > 0 and n <= 3:
25092510
libgap = self.parent()
@@ -2522,10 +2523,11 @@ cdef class GapElement_Function(GapElement):
25222523
(<GapElement>a[0]).value,
25232524
(<GapElement>a[1]).value)
25242525
elif n == 3:
2526+
v2 = (<GapElement>a[2]).value
25252527
result = GAP_CallFunc3Args(self.value,
25262528
(<GapElement>a[0]).value,
25272529
(<GapElement>a[1]).value,
2528-
(<GapElement>a[2]).value)
2530+
v2)
25292531
else:
25302532
arg_list = make_gap_list(args)
25312533
result = GAP_CallFuncList(self.value, arg_list)

0 commit comments

Comments
 (0)