Index: runtime/lib/double.cc |
diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc |
index 3fc2261b843032288b3fd21b80eb455fe6692767..37968776877068fad7fb56e5ad2f87f4eac579d5 100644 |
--- a/runtime/lib/double.cc |
+++ b/runtime/lib/double.cc |
@@ -221,9 +221,8 @@ DEFINE_NATIVE_ENTRY(Double_parse, 1) { |
} |
} |
if (dot_ok) { |
- char* p_end = NULL; |
- const double double_value = strtod(cstr, &p_end); |
- if (p_end == (cstr + len)) { |
+ double double_value; |
+ if (StringToDouble(cstr, len, &double_value)) { |
return Double::New(double_value); |
} |
} |
@@ -238,10 +237,14 @@ DEFINE_NATIVE_ENTRY(Double_parse, 1) { |
Token::kDOUBLE, |
&is_positive, |
&number_string)) { |
+ ASSERT(number_string->IsOneByteString()); |
const char* cstr = number_string->ToCString(); |
- char* p_end = NULL; |
- double double_value = strtod(cstr, &p_end); |
- ASSERT(p_end != cstr); |
+ |
+ double double_value; |
+ bool ok = StringToDouble(cstr, number_string->Length(), &double_value); |
+ USE(ok); |
+ ASSERT(ok); |
+ |
if (!is_positive) { |
double_value = -double_value; |
} |