Index: runtime/lib/date.cc |
diff --git a/runtime/lib/date.cc b/runtime/lib/date.cc |
index cf92809836bac21d94b09a1861a2534585972dd0..b68db08d1f0fcd0498b3d02f0ba7612a1b68d31a 100644 |
--- a/runtime/lib/date.cc |
+++ b/runtime/lib/date.cc |
@@ -12,13 +12,13 @@ |
namespace dart { |
-static int32_t kMaxAllowedSeconds = 2100000000; |
+static int32_t kMaxAllowedSeconds = kMaxInt32; |
rmacnak
2016/03/30 16:41:53
static int64_t kMaxAllowedSeconds = kMaxInt32;
regis
2016/03/30 17:09:35
Done.
|
DEFINE_NATIVE_ENTRY(DateTime_timeZoneName, 1) { |
GET_NON_NULL_NATIVE_ARGUMENT( |
Integer, dart_seconds, arguments->NativeArgAt(0)); |
int64_t seconds = dart_seconds.AsInt64Value(); |
- if (seconds < 0 || seconds > kMaxAllowedSeconds) { |
+ if (abs(seconds) > kMaxAllowedSeconds) { |
rmacnak
2016/03/30 16:41:53
llabs(seconds)
regis
2016/03/30 17:09:35
Done.
|
Exceptions::ThrowArgumentError(dart_seconds); |
} |
const char* name = OS::GetTimeZoneName(seconds); |
@@ -30,7 +30,7 @@ DEFINE_NATIVE_ENTRY(DateTime_timeZoneOffsetInSeconds, 1) { |
GET_NON_NULL_NATIVE_ARGUMENT( |
Integer, dart_seconds, arguments->NativeArgAt(0)); |
int64_t seconds = dart_seconds.AsInt64Value(); |
- if (seconds < 0 || seconds > kMaxAllowedSeconds) { |
+ if (abs(seconds) > kMaxAllowedSeconds) { |
rmacnak
2016/03/30 16:41:53
llabs(seconds)
regis
2016/03/30 17:09:35
Done.
|
Exceptions::ThrowArgumentError(dart_seconds); |
} |
int offset = OS::GetTimeZoneOffsetInSeconds(seconds); |