aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <[email protected]>2013-10-01 15:10:33 +0200
committerThe Qt Project <[email protected]>2013-10-03 09:24:32 +0200
commit8abf7f5876a48c0879bce628597533c7b6eca9a0 (patch)
treef01dd867b10affb44cefbe050a1f4fcb1a9dfcd1 /src/qml/jsruntime/qv4context.cpp
parenta8796a84fe45aa78123c661aab912f900f2ca0bc (diff)
Change v4 exceptions to use the common C++ ABIs foreign exceptions
On platforms where we use the common C++ ABI, throw the exception not using a dummy C++ exception structure and the throw keyboard, but instead use the lower-level _Unwind_RaiseException to throw a foreign exception. It is caught with the existing "catch (...)" and re-throw is implemented similarly, by grabbing the current exception from the globals (a standardized data structure) and re-throwing it. On platforms such as ARM that lack hooks for supplying our unwind tables to the system run-time, this patch will make it possible to link the unwinder statically into libQtQml (libgcc or libunwind) and thus force it to use our unwind tables, because throwing or re-throwing will always go through our statically linked code through direct calls to _Unwind_RaiseException (instead of libstdc++). Change-Id: Ic2ac056fc7ed9e93fb51e30ab45f35b260487c5f Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 78bf662c26..4bba0bfbd1 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -648,7 +648,7 @@ void ExecutionContext::throwUnimplemented(const QString &message)
ReturnedValue ExecutionContext::catchException(StackTrace *trace)
{
if (!engine->hasException)
- throw;
+ Exception::rethrow();
while (engine->current != this)
engine->popContext();
if (trace)
@@ -666,7 +666,7 @@ void ExecutionContext::rethrowException()
while (engine->current != this)
engine->popContext();
}
- throw;
+ Exception::rethrow();
}
void ExecutionContext::throwReferenceError(const ValueRef value)