|
|
DescriptionProtect base/numerics against change in intmax_t's underlying type
Adds a static_assert to catch if this ever changes, because that will
require changing some type promotion logic and other assumptions.
TBR=tsepez@chromium.org
Committed: https://crrev.com/beed850c4d92e005d1514a7f859259f5d0767dd1
Cr-Commit-Position: refs/heads/master@{#433085}
Patch Set 1 #
Total comments: 2
Messages
Total messages: 20 (8 generated)
The CQ bit was checked by jschuh@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2506093004/diff/1/base/numerics/safe_math_impl.h File base/numerics/safe_math_impl.h (right): https://codereview.chromium.org/2506093004/diff/1/base/numerics/safe_math_imp... base/numerics/safe_math_impl.h:60: static_assert(sizeof(uintmax_t) == 8, nit: Do you want a <= or >= comparison here? Does the code break in both directions?
https://codereview.chromium.org/2506093004/diff/1/base/numerics/safe_math_impl.h File base/numerics/safe_math_impl.h (right): https://codereview.chromium.org/2506093004/diff/1/base/numerics/safe_math_imp... base/numerics/safe_math_impl.h:60: static_assert(sizeof(uintmax_t) == 8, On 2016/11/17 17:04:54, Tom Sepez wrote: > nit: Do you want a <= or >= comparison here? Does the code break in both > directions? Good question. I can't really test, but I've seen enough implicit assumptions that will break in the > case. And I figure it's safer to be strict than not, assuming it makes it through the bots.
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by jschuh@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by jschuh@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by jschuh@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Description was changed from ========== Protect base/numerics against change in intmax_t's underlying type Adds a static_assert to catch if this ever changes, because that will require changing some type promotion logic and other assumptions. TBR=tsepez@chromium.org ========== to ========== Protect base/numerics against change in intmax_t's underlying type Adds a static_assert to catch if this ever changes, because that will require changing some type promotion logic and other assumptions. TBR=tsepez@chromium.org Committed: https://crrev.com/beed850c4d92e005d1514a7f859259f5d0767dd1 Cr-Commit-Position: refs/heads/master@{#433085} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/beed850c4d92e005d1514a7f859259f5d0767dd1 Cr-Commit-Position: refs/heads/master@{#433085} |