diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4memberdata.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4memberdata.cpp b/src/qml/jsruntime/qv4memberdata.cpp index f327c85001..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 > std::numeric_limits<int>::max()) - alloc = std::numeric_limits<int>::max(); + const size_t intMax = std::numeric_limits<int>::max(); + if (alloc > intMax) + alloc = intMax; Heap::MemberData *m; if (old) { |