aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4memberdata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4memberdata.cpp')
-rw-r--r--src/qml/jsruntime/qv4memberdata.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4memberdata.cpp b/src/qml/jsruntime/qv4memberdata.cpp
index ffebe1b5da..34b0c38ae6 100644
--- a/src/qml/jsruntime/qv4memberdata.cpp
+++ b/src/qml/jsruntime/qv4memberdata.cpp
@@ -72,8 +72,9 @@ Heap::MemberData *MemberData::allocate(ExecutionEngine *e, uint n, Heap::MemberD
// The above code can overflow in a number of interesting ways. All of those are unsigned,
// and therefore defined behavior. Still, apply some sane bounds.
- if (alloc > size_t(std::numeric_limits<int>::max()))
- alloc = size_t(std::numeric_limits<int>::max());
+ const size_t intMax = std::numeric_limits<int>::max();
+ if (alloc > intMax)
+ alloc = intMax;
Heap::MemberData *m;
if (old) {