aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_masm.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-23 14:03:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 10:38:50 +0100
commit4f8df70107d17922303bb21db5a2cf92aa1aff99 (patch)
treee59fc784bf25c29f667d8f83fdddc156dffe1339 /src/qml/compiler/qv4isel_masm.cpp
parent34bf0139c75de861c948391737af3c8c2a42703c (diff)
Implement new exception handling for moth
Add the required instructions and check for exceptions in the engine before storing any results. Change-Id: Ibfaf904d659859e8012920270825211ba202c63d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_masm.cpp')
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index 2d13b4d8c8..09fcbfd946 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -723,6 +723,9 @@ void InstructionSelection::run(int functionIndex)
}
}
+ if (!_as->exceptionReturnLabel.isSet())
+ visitRet(0);
+
JSC::MacroAssemblerCodeRef codeRef =_as->link(&compilationUnit->codeSizes[functionIndex]);
compilationUnit->codeRefs[functionIndex] = codeRef;
@@ -1909,7 +1912,10 @@ void InstructionSelection::visitCJump(V4IR::CJump *s)
void InstructionSelection::visitRet(V4IR::Ret *s)
{
- if (V4IR::Temp *t = s->expr->asTemp()) {
+ if (!s) {
+ // this only happens if the method doesn't have a return statement and can
+ // only exit through an exception
+ } else if (V4IR::Temp *t = s->expr->asTemp()) {
#if CPU(X86) || CPU(ARM)
# if CPU(X86)