aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compilercontrolflow_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-02 15:03:22 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-02 13:36:23 +0000
commit49946ef87478fb34dc017a0ff7592ef9a0336d31 (patch)
tree563f0decefd9e88ad3a3f88e4978bd78c9116ddd /src/qml/compiler/qv4compilercontrolflow_p.h
parent26532c66ee78d1aefbd3d02d7d149699f1c0ed95 (diff)
Don't create unwind handlers for things we can't unwind to
Check that the thing we want to unwind to is valid (e.g. and existing label), before attempting to create an unwind handler that is supposed to unwind towards this label. Change-Id: If5461d58f5db1590b14817a8c87c9eb5044c33b9 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilercontrolflow_p.h')
-rw-r--r--src/qml/compiler/qv4compilercontrolflow_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compilercontrolflow_p.h b/src/qml/compiler/qv4compilercontrolflow_p.h
index ac6c47c0b7..ba0c4751c9 100644
--- a/src/qml/compiler/qv4compilercontrolflow_p.h
+++ b/src/qml/compiler/qv4compilercontrolflow_p.h
@@ -310,7 +310,10 @@ struct ControlFlowCatch : public ControlFlowUnwind
}
virtual Handler getHandler(HandlerType type, const QString &label = QString()) {
- Handler h = ControlFlowUnwind::getHandler(type, label);
+ Handler h = getParentHandler(type, label);
+ if (h.type == Invalid)
+ return h;
+ h = ControlFlowUnwind::getHandler(type, label);
if (insideCatch)
// if we're inside the catch block, we need to jump to the pop scope
// instruction at the end of the catch block, not the unwind handler