diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-11 11:22:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-18 11:05:25 +0100 |
commit | 965878e88a9211b6995d57fddccf22ed365a9772 (patch) | |
tree | 9a1420b21c307e263c6f5ee269d08c8f14fdcdec /src/qml/jsruntime/qv4script.cpp | |
parent | a5d0ed01c8cbda9d6ec7e1a30b3f1266d3a277f8 (diff) |
Limit the amount of memory we allocate on the stack
Setup limits for both the C and the JS stack, and check
them before entering functions. If we run out of space,
throw a RangeError exception.
Be careful and recheck the stack bounds when things go
outside. This catches the case where the engine got
moved to another thread changing the stack boundaries.
Windows currently uses an unsafe fallback implementation,
this needs to be fixed later on.
Task-number: QTBUG-34568
Change-Id: I22fbcbec57b28f9cc8a49e12f1cc6e53e4f07888
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index 26cb0d940c..25791cff61 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -89,6 +89,8 @@ QmlBindingWrapper::QmlBindingWrapper(ExecutionContext *scope, ObjectRef qml) ReturnedValue QmlBindingWrapper::call(Managed *that, CallData *) { ExecutionEngine *engine = that->engine(); + CHECK_STACK_LIMITS(engine); + Scope scope(engine); QmlBindingWrapper *This = static_cast<QmlBindingWrapper *>(that); Q_ASSERT(This->function); |