Ignore:
Timestamp:
Aug 12, 2010, 11:22:34 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-12 Gabor Loki <[email protected]>

Reviewed by Geoffrey Garen.

Fix the array subscript is above array bounds warning in ByteArray on ARM.
https://bugs.webkit.org/show_bug.cgi?id=43358

The warning is very similar to this one: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37861

  • wtf/ByteArray.cpp: (WTF::ByteArray::create):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/ByteArray.cpp

    r40055 r65260  
    2626#include "config.h"
    2727#include "ByteArray.h"
     28#include "StdLibExtras.h"
    2829
    2930namespace WTF {
     
    3132PassRefPtr<ByteArray> ByteArray::create(size_t size)
    3233{
    33     unsigned char* buffer = new unsigned char[size + sizeof(ByteArray) - sizeof(size_t)];
     34    unsigned char* buffer = new unsigned char[size + OBJECT_OFFSETOF(ByteArray, m_data)];
    3435    ASSERT((reinterpret_cast<size_t>(buffer) & 3) == 0);
    3536    return adoptRef(new (buffer) ByteArray(size));
Note: See TracChangeset for help on using the changeset viewer.