Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 483e6a632a3e6f975a9f8bee259869d5e318251a..c10111aaa1ea93ff77c032717a28bedc2116da49 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -896,10 +896,10 @@ Handle<String> Factory::EmergencyNewError(const char* message, |
if (space > 0) { |
MaybeObject* maybe_arg = args->GetElement(isolate(), i); |
Handle<String> arg_str(reinterpret_cast<String*>(maybe_arg)); |
- const char* arg = *arg_str->ToCString(); |
+ SmartArrayPointer<char> arg = arg_str->ToCString(); |
Vector<char> v2(p, static_cast<int>(space)); |
- OS::StrNCpy(v2, arg, space); |
- space -= Min(space, strlen(arg)); |
+ OS::StrNCpy(v2, arg.get(), space); |
+ space -= Min(space, strlen(arg.get())); |
p = &buffer[kBufferSize] - space; |
} |
} |