Reviewers: Sven Panne,

Message:
Committed patchset #1 manually as r14993 (presubmit successful).

Description:
build fix for build fix for 14990

BUG=
[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=14993

Please review this at https://codereview.chromium.org/16409011/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M include/v8.h
  M test/cctest/test-api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index e35cc7a99852a8c6fdb1d231e05118192f75a8ec..519330aa2124b68961404f0b0119dba02891e18a 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -38,7 +38,6 @@
 #ifndef V8_H_
 #define V8_H_

-#include <limits.h>
 #include "v8stdint.h"

 #ifdef _WIN32
@@ -5683,7 +5682,9 @@ void ReturnValue<T>::Set(int32_t i) {
 template<typename T>
 void ReturnValue<T>::Set(uint32_t i) {
   typedef internal::Internals I;
-  if (V8_LIKELY(i <= INT32_MAX)) {
+  // Can't simply use INT32_MAX here for whatever reason.
+  bool fits_into_int32_t = (i & (1 << 31)) == 0;
+  if (V8_LIKELY(fits_into_int32_t)) {
     Set(static_cast<int32_t>(i));
     return;
   }
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 22b93784bc0ef30910d091bbb19e8238eaa299e8..f6d30a9c8a00b86c581a9c5626061c1b387a81c1 100755
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -1099,7 +1099,7 @@ THREADED_TEST(FastReturnValues) {
   // check int32_t and uint32_t
   int32_t int_values[] = {
       0, 234, -723,
-      i::Smi::kMinValue, i::Smi::kMaxValue, INT32_MAX, INT32_MIN
+      i::Smi::kMinValue, i::Smi::kMaxValue
   };
   for (size_t i = 0; i < ARRAY_SIZE(int_values); i++) {
     for (int modifier = -1; modifier <= 1; modifier++) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to