summaryrefslogtreecommitdiffstats
path: root/webkit/port/bindings/v8
diff options
context:
space:
mode:
authorplesner@google.com <plesner@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-05 14:40:51 +0000
committerplesner@google.com <plesner@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-05 14:40:51 +0000
commitf1ac056488379b5f3221c658b32a1b783e87b9e9 (patch)
treeda2a6107e03012407345c63428e4e120b23e5ae4 /webkit/port/bindings/v8
parentb56165e4a87c532449b0f338821580db8b36fa43 (diff)
downloadchromium_src-f1ac056488379b5f3221c658b32a1b783e87b9e9.zip
chromium_src-f1ac056488379b5f3221c658b32a1b783e87b9e9.tar.gz
chromium_src-f1ac056488379b5f3221c658b32a1b783e87b9e9.tar.bz2
Fixed crash when stack overflow occurs while creating the constructor
for a don wrapper type. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/bindings/v8')
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp
index e76f9de..bfa26f3 100644
--- a/webkit/port/bindings/v8/v8_proxy.cpp
+++ b/webkit/port/bindings/v8/v8_proxy.cpp
@@ -1376,7 +1376,11 @@ v8::Local<v8::Function> V8Proxy::GetConstructor(
proto = v8::Persistent<v8::String>::New(v8::String::New("__proto__"));
}
v8::Handle<v8::FunctionTemplate> templ = GetTemplate(t);
+ v8::TryCatch try_catch;
+ // This might fail if we're running out of stack or memory.
v8::Local<v8::Function> value = templ->GetFunction();
+ if (value.IsEmpty())
+ return v8::Local<v8::Function>();
m_constructor_cache->Set(v8::Integer::New(t), value);
value->Set(proto, m_initial_object_prototype);
return value;