From 4e835a592901364599da364cfe2006f99e34a6c9 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 6 Feb 2014 10:42:00 +0200 Subject: Fix alignment exception in newCallContext on ARM CallContext::locals was not at multiple of 8, which caused an alignment exception on ARM. Size for the context is also increased. Change-Id: I136418f89945cd3fec74463659107c6dab7cad0a Reviewed-by: aavit Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4context.cpp | 2 +- src/qml/jsruntime/qv4context_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index c2c9aefd5f..8c6d75d1de 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -91,7 +91,7 @@ CallContext *ExecutionContext::newCallContext(FunctionObject *function, CallData c->lookups = c->compilationUnit->runtimeLookups; } - c->locals = (SafeValue *)(c + 1); + c->locals = (SafeValue *)((quintptr(c + 1) + 7) & ~7); if (function->varCount) std::fill(c->locals, c->locals + function->varCount, Primitive::undefinedValue()); diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 334d033193..9f905df15c 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -241,7 +241,7 @@ struct ExecutionContextSaver /* Function *f, int argc */ #define requiredMemoryForExecutionContect(f, argc) \ - sizeof(CallContext) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount)) + sizeof(CallData) + ((sizeof(CallContext) + 7) & ~7) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount)) + sizeof(CallData) } // namespace QV4 -- cgit v1.2.3