Ignore:
Timestamp:
Feb 17, 2007, 1:07:39 AM (18 years ago)
Author:
kjk
Message:

JavaScriptCore:

Reviewed by Adam Roben.

Fix crashes on ARM due to different struct packing. Based on a patch
by Mike Emmel.

  • kjs/ustring.cpp: compile-time assert to make sure sizeof(UChar) == 2
  • kjs/ustring.h: pack UChar struct to ensure that sizeof(UChar) == 2
  • wtf/Assertions.h: add COMPILE_ASSERT macro for compile-time assertions

WebCore:

Reviewed by Adam Roben.

Fix crashes on ARM due to different struct packing. Based on a patch
from Mike Emmel.

  • platform/DeprecatedString.cpp: compile-time assert to make sure sizeof(DeprecatedChar) == 2
  • platform/DeprecatedString.h: pack DeprecatedChar struct to ensure that sizeof(DeprecatedChar) == 2. Move _internalBuffer in DeprecatedStringData to the end, to avoid crashes on ARM due to different struct packing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Assertions.h

    r17127 r19679  
    156156#endif
    157157
     158/* COMPILE_ASSERT */
     159#ifndef COMPILE_ASSERT
     160#define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
     161#endif
     162
    158163/* FATAL */
    159164
Note: See TracChangeset for help on using the changeset viewer.