Fix crash with v8-bench.js
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 21 Mar 2013 01:08:36 +0000 (02:08 +0100)
committerLars Knoll <lars.knoll@digia.com>
Thu, 21 Mar 2013 09:07:55 +0000 (10:07 +0100)
commit4737f7a5d889bde87e52b2f50ed7693d9b410aa7
treebe41a92d9267e0adfc128d70838e492691954215
parent5fefa66d5d6140c392af76326c8fb2d3f4f70261
Fix crash with v8-bench.js

Sometimes the arguments array of the context is provided by the caller and not
copied. In that case the address may not be valid anymore after the call, so
we need to reset arguments/argumentCount after the call in popContext, otherwise
we end up calling mark() on dangling pointers.

Also make sure to mark the entire arguments array, not too much and not too little,
i.e. use argumentCount.

Change-Id: I8b96521b0fb15142ed8c723a9354d275be48cc58
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/v4/qv4context.cpp
src/v4/qv4context.h
src/v4/qv4engine.cpp