diff options
author | Jan Arve Saether <jan-arve.saether@qt.io> | 2017-06-26 18:38:27 +0200 |
---|---|---|
committer | Jan Arve Saether <jan-arve.saether@qt.io> | 2017-07-11 16:44:33 +0200 |
commit | b6e6e737f1a4a7e48989a6a036e25c238304802f (patch) | |
tree | 8d4b5940b92ad1fc94e46c1742acd9355e19e1d4 /src/qml/jit/qv4unop.cpp | |
parent | d5b3f5da9cfa90fc43f29f3bdeec01884a47d6ca (diff) | |
parent | 4beee1a6dcc1be57aa6fb2a175dadc6ff298545d (diff) |
Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Conflicts:
examples/quick/shared/LauncherList.qml
src/quick/items/qquickevents.cpp
src/quick/items/qquickevents_p_p.h
src/quick/items/qquickwindow.cpp
tests/auto/quick/touchmouse/tst_touchmouse.cpp
Change-Id: Id692d291455093fc72db61f1b854f3fc9190267b
Diffstat (limited to 'src/qml/jit/qv4unop.cpp')
-rw-r--r-- | src/qml/jit/qv4unop.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/jit/qv4unop.cpp b/src/qml/jit/qv4unop.cpp index 896be07ed5..78546e1509 100644 --- a/src/qml/jit/qv4unop.cpp +++ b/src/qml/jit/qv4unop.cpp @@ -83,6 +83,15 @@ template <typename JITAssembler> void Unop<JITAssembler>::generateUMinus(IR::Expr *source, IR::Expr *target) { IR::Temp *targetTemp = target->asTemp(); + + if (IR::Const *c = source->asConst()) { + if (c->value == 0 && source->type == IR::SInt32Type) { + // special case: minus integer 0 is 0, which is not what JS expects it to be, so always + // do a runtime call + generateRuntimeCall(_as, target, uMinus, PointerToValue(source)); + return; + } + } if (source->type == IR::SInt32Type) { typename JITAssembler::RegisterID tReg = JITAssembler::ScratchRegister; if (targetTemp && targetTemp->kind == IR::Temp::PhysicalRegister) |