Changeset 65260 in webkit


Ignore:
Timestamp:
Aug 12, 2010 11:22:34 AM (14 years ago)
Author:
loki@webkit.org
Message:

2010-08-12 Gabor Loki <loki@webkit.org>

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):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r65255 r65260  
     12010-08-12  Gabor Loki  <loki@webkit.org>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Fix the array subscript is above array bounds warning in ByteArray on ARM.
     6        https://bugs.webkit.org/show_bug.cgi?id=43358
     7
     8        The warning is very similar to this one: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37861
     9
     10        * wtf/ByteArray.cpp:
     11        (WTF::ByteArray::create):
     12
    1132010-08-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    214
  • 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.