Index: src/func-name-inferrer.cc |
diff --git a/src/func-name-inferrer.cc b/src/func-name-inferrer.cc |
index 5409a4e1800c56a788a7649f7f7cd42c53363c91..441113b7d8de3ae272fcb156026f5cfd65ebd1e6 100644 |
--- a/src/func-name-inferrer.cc |
+++ b/src/func-name-inferrer.cc |
@@ -83,11 +83,14 @@ Handle<String> FuncNameInferrer::MakeNameFromStackHelper(int pos, |
return MakeNameFromStackHelper(pos + 1, prev); |
} else { |
if (prev->length() > 0) { |
+ Handle<String> name = names_stack_.at(pos).name; |
+ if (prev->length() + name->length() + 1 > String::kMaxLength) return prev; |
Factory* factory = isolate()->factory(); |
- Handle<String> curr = factory->NewConsString( |
- factory->dot_string(), names_stack_.at(pos).name); |
- return MakeNameFromStackHelper(pos + 1, |
- factory->NewConsString(prev, curr)); |
+ Handle<String> curr = factory->NewConsString(factory->dot_string(), name); |
+ CHECK_NOT_EMPTY_HANDLE(isolate(), curr); |
+ curr = factory->NewConsString(prev, curr); |
+ CHECK_NOT_EMPTY_HANDLE(isolate(), curr); |
+ return MakeNameFromStackHelper(pos + 1, curr); |
} else { |
return MakeNameFromStackHelper(pos + 1, names_stack_.at(pos).name); |
} |