[SERVER-31310] Use SafeInt functions for MSVC overflow detection Created: 28/Sep/17 Updated: 30/Oct/23 Resolved: 05/Sep/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Dev Tools 2019-07-01, Dev Tools 2019-08-26, Dev Tools 2019-09-09 | ||||||||
| Participants: | |||||||||
| Description |
|
We can't use the signed specializations on MSVC2015 due to a typo in the library. That typo looks like it was fixed in MSVC2017 so we should try again after upgrading. Switching to SafeInt functions allows us to use templated overflow detection functions rather than supporting a fixed set of types, encoded into the function names, and providing an separate implementation for every one. |
| Comments |
| Comment by Billy Donahue [ 05/Sep/19 ] |
|
Our API is now a set of overloads on 3 functions: mongo::overflow:: {mul,add,sub}. Internally those are using MSVC SafeInt functions, but there's not a hard need to encode the typenames into the API functions. The API can internally sort out which SafeInt functions to call. Anyway, the internals might still benefit from an upgrade, it's just that the API is now only 3 names. |
| Comment by Andrew Morrow (Inactive) [ 10/Jul/19 ] |
|
Moving to Q3 quick wins for dev tools. I think this is a straightforward refactoring and probably worth doing. |
| Comment by Andrew Morrow (Inactive) [ 22/Jun/19 ] |
|
redbeard0531 - Did the work done under |