summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorsgjesse@chromium.org <sgjesse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-24 07:41:08 +0000
committersgjesse@chromium.org <sgjesse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-24 07:41:08 +0000
commitf50e9970d0aa02dcd35f10df4c4deb4568acab51 (patch)
tree55d175377d1806c231b9e188b33399ee4528c9f5 /webkit
parent07ae2c333da12779c87eefcd65f4272e389766f3 (diff)
downloadchromium_src-f50e9970d0aa02dcd35f10df4c4deb4568acab51.zip
chromium_src-f50e9970d0aa02dcd35f10df4c4deb4568acab51.tar.gz
chromium_src-f50e9970d0aa02dcd35f10df4c4deb4568acab51.tar.bz2
Add a check for empty handle in V8Proxy::GetSourceLineNumber()
If an exception occours in some of the code used to locate the line number of the source on the top stack frame an empty handle will be returned and using Int32Value on it will cause a crash. As of now I have not been able to find a case where an exception to happens though. BUG=7912 Review URL: http://codereview.chromium.org/28024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp
index cebfd55..18101d6 100644
--- a/webkit/port/bindings/v8/v8_proxy.cpp
+++ b/webkit/port/bindings/v8/v8_proxy.cpp
@@ -3474,7 +3474,11 @@ int V8Proxy::GetSourceLineNumber() {
if (frame_source_line.IsEmpty()) {
return 0;
}
- return v8::Debug::Call(frame_source_line)->Int32Value();
+ v8::Handle<v8::Value> result = v8::Debug::Call(frame_source_line);
+ if (result.IsEmpty()) {
+ return 0;
+ }
+ return result->Int32Value();
}