Ignore:
Timestamp:
May 23, 2008, 2:38:30 AM (17 years ago)
Author:
[email protected]
Message:

Fix <rdar://problem/5954997> global-recursion-on-full-stack.html crashes under guardmalloc.

Growing the register file with uncheckedGrow from within Machine::execute is not safe as the
register file may be too close to its maximum size to grow successfully. By using grow,
checking the result and throwing a stack overflow error we can avoid crashing.

Reviewed by Oliver Hunt.

  • VM/Machine.cpp:

(KJS::Machine::execute):

  • VM/RegisterFile.h: Remove the now-unused uncheckedGrow.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/RegisterFile.h

    r33979 r34069  
    125125            return true;
    126126        }
    127        
    128         void uncheckedGrow(size_t size)
    129         {
    130             if (size > m_size) {
    131                 if (size > m_capacity)
    132                     growBuffer(size, std::numeric_limits<size_t>::max());
    133 
    134                 m_size = size;
    135             }       
    136         }
    137127
    138128        size_t size() { return m_size; }
Note: See TracChangeset for help on using the changeset viewer.