Comment #1 on issue 3348 by [email protected]: v8 Intl doesn't handle failure conditions
http://code.google.com/p/v8/issues/detail?id=3348

(Oops, it could be a little more detailed.)

the i18n.cc functions do NOT check for null returns from the CreateICUXX.. functions. This can happen if incomplete/insufficient locale data is present.

Below are diffs from node's repo FWIW. They don't solve the problem, just kick it down the road.


diff --git a/deps/v8/src/i18n.cc b/deps/v8/src/i18n.cc
index 4c7a32d..6f0f2ff 100644
--- a/deps/v8/src/i18n.cc
+++ b/deps/v8/src/i18n.cc
@@ -840,9 +840,11 @@ icu::SimpleDateFormat* DateFormat::InitializeDateTimeFormat(
     icu::Locale no_extension_locale(icu_locale.getBaseName());
date_format = CreateICUDateFormat(isolate, no_extension_locale, options);

-    // Set resolved settings (pattern, numbering system, calendar).
-    SetResolvedDateSettings(
-        isolate, no_extension_locale, date_format, resolved);
+    if(date_format!=NULL) {
+      // Set resolved settings (pattern, numbering system, calendar).
+      SetResolvedDateSettings(
+ isolate, no_extension_locale, date_format, resolved);
+    }
   } else {
     SetResolvedDateSettings(isolate, icu_locale, date_format, resolved);
   }
@@ -914,9 +916,11 @@ icu::DecimalFormat* NumberFormat::InitializeNumberFormat(
     number_format = CreateICUNumberFormat(
         isolate, no_extension_locale, options);

-    // Set resolved settings (pattern, numbering system).
-    SetResolvedNumberSettings(
+    if(number_format) {
+      // Set resolved settings (pattern, numbering system).
+      SetResolvedNumberSettings(
         isolate, no_extension_locale, number_format, resolved);
+    }
   } else {
SetResolvedNumberSettings(isolate, icu_locale, number_format, resolved);
   }
@@ -971,9 +975,11 @@ icu::Collator* Collator::InitializeCollator(
     icu::Locale no_extension_locale(icu_locale.getBaseName());
     collator = CreateICUCollator(isolate, no_extension_locale, options);

-    // Set resolved settings (pattern, numbering system).
-    SetResolvedCollatorSettings(
-        isolate, no_extension_locale, collator, resolved);
+    if(collator) {
+      // Set resolved settings (pattern, numbering system).
+      SetResolvedCollatorSettings(
+      isolate, no_extension_locale, collator, resolved);
+    }
   } else {
     SetResolvedCollatorSettings(isolate, icu_locale, collator, resolved);
   }
@@ -1029,9 +1035,11 @@ icu::BreakIterator* BreakIterator::InitializeBreakIterator(
     break_iterator = CreateICUBreakIterator(
         isolate, no_extension_locale, options);

-    // Set resolved settings (locale).
-    SetResolvedBreakIteratorSettings(
-        isolate, no_extension_locale, break_iterator, resolved);
+    if(break_iterator) {
+      // Set resolved settings (locale).
+      SetResolvedBreakIteratorSettings(
+       isolate, no_extension_locale, break_iterator, resolved);
+    }
   } else {
     SetResolvedBreakIteratorSettings(
         isolate, icu_locale, break_iterator, resolved);



Trackback: https://github.com/joyent/node/issues/7676

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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/d/optout.

Reply via email to