Skip to content

Commit e9415d4

Browse files
author
Release Manager
committed
gh-35701: GAP: fix definition of 'Int' The GAP Int type, like UInt, has the size of a machine pointer (at least on the usual desktop system architectures), not a machine int. I.e. on a typical 64bit OS it is a 64bit integer, not a 32bit integer. This often makes no difference on little endian systems but can have disastrous consequences for large values or on big endian systems. Also fix a copy&paste mistake in the `make_gap_integer` argument name. URL: #35701 Reported by: Max Horn Reviewer(s): Frédéric Chapoton
2 parents bc6d3bd + db93a1a commit e9415d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/sage/libs/gap/element.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ from sage.structure.element cimport Element, ModuleElement, RingElement
1515
cdef Obj make_gap_list(sage_list) except NULL
1616
cdef Obj make_gap_matrix(sage_list, gap_ring) except NULL
1717
cdef Obj make_gap_record(sage_dict) except NULL
18-
cdef Obj make_gap_integer(sage_dict) except NULL
18+
cdef Obj make_gap_integer(sage_int) except NULL
1919
cdef Obj make_gap_string(sage_string) except NULL
2020

2121
cdef GapElement make_any_gap_element(parent, Obj obj)

src/sage/libs/gap/gap_includes.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
# http://www.gnu.org/licenses/
1010
###############################################################################
1111

12-
from libc.stdint cimport uintptr_t, uint8_t, uint16_t, uint32_t, uint64_t
12+
from libc.stdint cimport intptr_t, uintptr_t, uint8_t, uint16_t, uint32_t, uint64_t
1313

1414
cdef extern from "gap/system.h" nogil:
1515
ctypedef char Char
16-
ctypedef int Int
16+
ctypedef intptr_t Int
1717
ctypedef uintptr_t UInt
1818
ctypedef uint8_t UInt1
1919
ctypedef uint16_t UInt2

0 commit comments

Comments
 (0)