diff options
author | Fawzi Mohamed <[email protected]> | 2014-04-16 00:42:40 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-04-30 18:24:08 +0200 |
commit | 7ea1f75fd877f312d70a90ab0405f3ca03914171 (patch) | |
tree | de7e083482666a538672f420dccc2727c3cb6833 /src/qml/jsruntime | |
parent | 33268b1165eb03fb51de125d0da726d613f49b2d (diff) |
v4: ignore quiet bit for NaNs in 32 bit value encoding
on iOS x % 0 generates a NaN with the silent bit set, i.e.
0x7ffc_0000_0000_0000 which was interpreted as a null managed object
which crashed the interpreter.
Task-number: QTBUG-36859
Change-Id: Idf31ad9f0454f83d321b49b2f76bdbc2ee906189
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 3f83d7b25e..29cb8b42ed 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -119,20 +119,21 @@ struct Q_QML_PRIVATE_EXPORT Value #if QT_POINTER_SIZE == 4 enum Masks { - NaN_Mask = 0x7ff80000, - NotDouble_Mask = 0x7ffc0000, - Type_Mask = 0xffff8000, - Immediate_Mask = NotDouble_Mask | 0x00008000, - IsNullOrUndefined_Mask = Immediate_Mask | 0x20000, + SilentNaNBit = 0x00040000, + NaN_Mask = 0x7ff80000, + NotDouble_Mask = 0x7ffa0000, + Type_Mask = 0xffffc000, + Immediate_Mask = NotDouble_Mask | 0x00004000 | SilentNaNBit, + IsNullOrUndefined_Mask = Immediate_Mask | 0x08000, Tag_Shift = 32 }; enum ValueType { Undefined_Type = Immediate_Mask | 0x00000, - Null_Type = Immediate_Mask | 0x10000, - Boolean_Type = Immediate_Mask | 0x20000, - Integer_Type = Immediate_Mask | 0x30000, - Managed_Type = NotDouble_Mask | 0x00000, - Empty_Type = NotDouble_Mask | 0x30000 + Null_Type = Immediate_Mask | 0x10000, + Boolean_Type = Immediate_Mask | 0x08000, + Integer_Type = Immediate_Mask | 0x18000, + Managed_Type = NotDouble_Mask | 0x00000 | SilentNaNBit, + Empty_Type = NotDouble_Mask | 0x18000 | SilentNaNBit }; enum ImmediateFlags { |