Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 279187 | Differences between
and this patch

Collapse All | Expand All

(-)branches/KDE/4.3/kdelibs/kjs/collector.cpp (+4 lines)
Lines 31-36 Link Here
31
#include "value.h"
31
#include "value.h"
32
32
33
#include <setjmp.h>
33
#include <setjmp.h>
34
#include <limits.h>
34
#include <algorithm>
35
#include <algorithm>
35
36
36
#if PLATFORM(DARWIN)
37
#if PLATFORM(DARWIN)
Lines 109-114 Link Here
109
110
110
    void append(CollectorBlock* block) {
111
    void append(CollectorBlock* block) {
111
        if (m_used == m_capacity) {
112
        if (m_used == m_capacity) {
113
            static const size_t maxNumBlocks = ULONG_MAX / sizeof(CollectorBlock*) / GROWTH_FACTOR;
114
            if (m_capacity > maxNumBlocks)
115
                CRASH();
112
            m_capacity = max(MIN_ARRAY_SIZE, m_capacity * GROWTH_FACTOR);
116
            m_capacity = max(MIN_ARRAY_SIZE, m_capacity * GROWTH_FACTOR);
113
            m_data = static_cast<CollectorBlock **>(fastRealloc(m_data, m_capacity * sizeof(CollectorBlock *)));
117
            m_data = static_cast<CollectorBlock **>(fastRealloc(m_data, m_capacity * sizeof(CollectorBlock *)));
114
        }
118
        }

Return to bug 279187