diff options
-rw-r--r-- | src/qml/common/qv4stringtoarrayindex_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4math_p.h | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4typedarray.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/common/qv4stringtoarrayindex_p.h b/src/qml/common/qv4stringtoarrayindex_p.h index fc71ca7072..7bdabd4f3f 100644 --- a/src/qml/common/qv4stringtoarrayindex_p.h +++ b/src/qml/common/qv4stringtoarrayindex_p.h @@ -43,7 +43,7 @@ uint stringToArrayIndex(const T *ch, const T *end) uint x = charToUInt(ch) - '0'; if (x > 9) return std::numeric_limits<uint>::max(); - if (mul_overflow(i, uint(10), &i) || add_overflow(i, x, &i)) // i = i * 10 + x + if (qMulOverflow(i, uint(10), &i) || qAddOverflow(i, x, &i)) // i = i * 10 + x return std::numeric_limits<uint>::max(); ++ch; } diff --git a/src/qml/jsruntime/qv4math_p.h b/src/qml/jsruntime/qv4math_p.h index 2692c2617b..b12990700d 100644 --- a/src/qml/jsruntime/qv4math_p.h +++ b/src/qml/jsruntime/qv4math_p.h @@ -34,7 +34,7 @@ namespace QV4 { static inline QMLJS_READONLY ReturnedValue add_int32(int a, int b) { int result; - if (Q_UNLIKELY(add_overflow(a, b, &result))) + if (Q_UNLIKELY(qAddOverflow(a, b, &result))) return StaticValue::fromDouble(static_cast<double>(a) + b).asReturnedValue(); return StaticValue::fromInt32(result).asReturnedValue(); } @@ -42,7 +42,7 @@ static inline QMLJS_READONLY ReturnedValue add_int32(int a, int b) static inline QMLJS_READONLY ReturnedValue sub_int32(int a, int b) { int result; - if (Q_UNLIKELY(sub_overflow(a, b, &result))) + if (Q_UNLIKELY(qSubOverflow(a, b, &result))) return StaticValue::fromDouble(static_cast<double>(a) - b).asReturnedValue(); return StaticValue::fromInt32(result).asReturnedValue(); } @@ -50,7 +50,7 @@ static inline QMLJS_READONLY ReturnedValue sub_int32(int a, int b) static inline QMLJS_READONLY ReturnedValue mul_int32(int a, int b) { int result; - if (Q_UNLIKELY(mul_overflow(a, b, &result))) + if (Q_UNLIKELY(qMulOverflow(a, b, &result))) return StaticValue::fromDouble(static_cast<double>(a) * b).asReturnedValue(); // need to handle the case where one number is negative and the other 0 ==> -0 if (((a < 0) xor (b < 0)) && (result == 0)) diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp index 3027cdf94f..43dc0fae4f 100644 --- a/src/qml/jsruntime/qv4typedarray.cpp +++ b/src/qml/jsruntime/qv4typedarray.cpp @@ -373,7 +373,7 @@ ReturnedValue TypedArrayCtor::virtualCallAsConstructor(const FunctionObject *f, uint elementSize = operations[that->d()->type].bytesPerElement; size_t bufferSize; - if (mul_overflow(size_t(l), size_t(elementSize), &bufferSize)) + if (qMulOverflow(size_t(l), size_t(elementSize), &bufferSize)) return scope.engine->throwRangeError(QLatin1String("new TypedArray: invalid length")); Scoped<ArrayBuffer> newBuffer(scope, scope.engine->newArrayBuffer(bufferSize)); if (scope.hasException()) |