Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Issue 256048: Add CHECK_INT64_EQ function to avoid operand size ambiguities. (Closed)

Created:
11 years, 2 months ago by William Hesse
Modified:
9 years, 7 months ago
Reviewers:
plesner, antonm
CC:
v8-dev
Visibility:
Public.

Description

Add CHECK_INT64_EQ function to avoid operand size ambiguities. Committed: http://code.google.com/p/v8/source/detail?r=3016

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -24 lines) Patch
M src/checks.h View 3 chunks +14 lines, -11 lines 0 comments Download
M test/cctest/test-api.cc View 7 chunks +7 lines, -13 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
William Hesse
The casts aren't necessary, but they make it explicit.
11 years, 2 months ago (2009-10-03 13:30:48 UTC) #1
William Hesse
11 years, 2 months ago (2009-10-03 13:45:22 UTC) #2
TBR=plesner@chromium.org

To have CHECK_EQ for both 32-bit and 64-bit ints, we need to handle the
following cases, on both 32- and 64- bit platforms:
Comparing int32_t to uint32_t, where we want to reinterpret them as both int32_t
Comparing int32_t to intptr_t - this would need explicit casts in all cases.
Comparing int64_t to intptr_t

So I think a separate CHECK_INT64_EQ is safer than overloading, or having only a
64-bit CHECK_EQ, with all integer types upconverted (that breaks comparisons
between int32_t and uint32_t that want to reinterpret then as 32-bit patterns).

Powered by Google App Engine
This is Rietveld 408576698