Fix failing assertion inside MSVC STL in debug builds
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 29 Apr 2014 12:45:13 +0000 (14:45 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 21 May 2014 14:20:35 +0000 (16:20 +0200)
commit932ebc4e7c2a67538a36e311c32e00d434de189e
treee8ee350c2d79ebff80cb8cfdf941af690edbcd94
parent358436f32a4e35091e8b56e32cf639b303665426
Fix failing assertion inside MSVC STL in debug builds

When using FunctionObject's call() method, we use std::copy to copy the
arguments over to the new call context. Unfortunately std::copy has an
assertion in there to check that we're not copying out of bounds.  What the STL
doesn't know is that the Value args[1] array is dynamically allocated and
easily expands beyond just one entry.

Fall back to copying by hand to work around this issue.

Task-number: QTBUG-38195
Change-Id: I6e254b1c893ccf5cad2358179cda1b07b00228e0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/jsruntime/qv4functionobject.cpp