Fix null handle deref in InternalDateFormat
authorjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 20 Aug 2013 08:17:43 +0000 (08:17 +0000)
committerjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 20 Aug 2013 08:17:43 +0000 (08:17 +0000)
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/22927014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16237 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/runtime.cc

index 34fc99d..6aafa05 100644 (file)
@@ -13649,7 +13649,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalDateFormat) {
   CONVERT_ARG_HANDLE_CHECKED(JSDate, date, 1);
 
   bool has_pending_exception = false;
-  double millis = Execution::ToNumber(date, &has_pending_exception)->Number();
+  Handle<Object> value = Execution::ToNumber(date, &has_pending_exception);
   if (has_pending_exception) {
     ASSERT(isolate->has_pending_exception());
     return Failure::Exception();
@@ -13660,7 +13660,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalDateFormat) {
   if (!date_format) return isolate->ThrowIllegalOperation();
 
   icu::UnicodeString result;
-  date_format->format(millis, result);
+  date_format->format(value->Number(), result);
 
   return *isolate->factory()->NewStringFromTwoByte(
       Vector<const uint16_t>(