Opened 10 years ago
Closed 10 years ago
#1377 closed defect (fixed)
[with patch, with positive review] technically incorrect code in integer_mod.pyx
Reported by: | cwitty | Owned by: | somebody |
---|---|---|---|
Priority: | trivial | Milestone: | sage-2.9 |
Component: | basic arithmetic | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
There is code in integer_mod.pyx that coerces a Python int into an int_fast32_t. This is wrong, since a Python int can hold a C long; so this might truncate if sizeof(int_fast32_t) < sizeof(long).
However, the bug has little or no practical effect, since:
1) on 64-bit x86 Linux, sizeof(int_fast32_t) == sizeof(long);
2) the problem only occurs if you call IntegerMod_int
directly (which nobody should); it looks like all the wrappers do the modulo before they create the IntegerMod_int
.
Attachments (1)
Change History (3)
Changed 10 years ago by
comment:1 Changed 10 years ago by
- Component changed from algebraic geometry to basic arithmetic
- Owner changed from was to somebody
- Summary changed from [with patch] technically incorrect code in integer_mod.pyx to [with patch, with positive review] technically incorrect code in integer_mod.pyx
comment:2 Changed 10 years ago by
- Resolution set to fixed
- Status changed from new to closed
Merged in 2.9.alpha0.
Note: See
TracTickets for help on using
tickets.
Looks good to me.