Fix binop related crashes in the interpreter
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 9 Aug 2013 08:06:10 +0000 (10:06 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 9 Aug 2013 11:44:00 +0000 (13:44 +0200)
commitfc6afa7f7d567f32d167f04b659e7bf4f546f48d
tree711ab60b76bb608068721f7ad0ed565540d057fd
parentf21e01ed220d342990e53817570edd28fb61663d
Fix binop related crashes in the interpreter

if (foo instanceof blah) would crash because we generated a BinOp instruction
with a null aluop pointer. Instanceof, in and add are binops that now require
a context, and thus require a different instruction (BinOpContext). This was
already handled by the traditional binop() of the isel, but not by the binop
expression that can be in a cjump. Centralize the code by calling a common
binop helper from isel binop as well as cjump.

Change-Id: I793ee3eebe56db4c86d5399a783a84be3093fd35
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qv4isel_moth.cpp
src/qml/compiler/qv4isel_moth_p.h