diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-09 10:06:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-09 13:44:00 +0200 |
commit | fc6afa7f7d567f32d167f04b659e7bf4f546f48d (patch) | |
tree | 711ab60b76bb608068721f7ad0ed565540d057fd /src/qml/compiler/qv4isel_moth_p.h | |
parent | f21e01ed220d342990e53817570edd28fb61663d (diff) |
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>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth_p.h')
-rw-r--r-- | src/qml/compiler/qv4isel_moth_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index 315d798075..57fc9644ad 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -126,6 +126,8 @@ protected: virtual void inplaceMemberOp(V4IR::AluOp oper, V4IR::Temp *source, V4IR::Temp *targetBase, const QString &targetName); private: + Instr::Param binopHelper(V4IR::AluOp oper, V4IR::Expr *leftSource, V4IR::Expr *rightSource, V4IR::Temp *target); + struct Instruction { #define MOTH_INSTR_DATA_TYPEDEF(I, FMT) typedef InstrData<Instr::I> I; FOR_EACH_MOTH_INSTR(MOTH_INSTR_DATA_TYPEDEF) |