projects
/
platform
/
upstream
/
qtdeclarative.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59d5c5c
)
Fix crash when throwing an exception from within a constructor
author
Simon Hausmann
<simon.hausmann@digia.com>
Wed, 23 Jul 2014 13:10:58 +0000
(15:10 +0200)
committer
Lars Knoll
<lars.knoll@digia.com>
Thu, 31 Jul 2014 07:03:00 +0000
(09:03 +0200)
We need to check for the exception before doing anything with the returned
value.
Change-Id: I0086be96b2df2434b95187489d7430ae67f561a1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/jsruntime/qv4functionobject.cpp
patch
|
blob
|
history
diff --git
a/src/qml/jsruntime/qv4functionobject.cpp
b/src/qml/jsruntime/qv4functionobject.cpp
index
1097478
..
29628eb
100644
(file)
--- a/
src/qml/jsruntime/qv4functionobject.cpp
+++ b/
src/qml/jsruntime/qv4functionobject.cpp
@@
-386,6
+386,9
@@
ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData)
if (f->function()->compiledFunction->hasQmlDependencies())
QmlContextWrapper::registerQmlDependencies(v4, f->function()->compiledFunction);
+ if (v4->hasException)
+ return Encode::undefined();
+
if (result->isObject())
return result.asReturnedValue();
return obj.asReturnedValue();