HomePhabricator

sanitizer: Fix endianness checks for gcc

Description

sanitizer: Fix endianness checks for gcc

Summary:
BIG_ENDIAN and LITTLE_ENDIAN are not supported by gcc, which
eg. for ubsan Value::getFloatValue will silently fall through to
the little endian branch, breaking display of float values by ubsan.
Use BYTE_ORDER == ORDER_BIG/LITTLE_ENDIAN as the condition
instead, which is supported by both clang and gcc.

Noticed while porting ubsan to s390x.

Patch by Marcin Koƛcielnicki!

Differential Revision: http://reviews.llvm.org/D17660

Details

Committed
samsonovMar 9 2016, 3:39 PM
Differential Revision
D17660: sanitizer: Fix endianness checks for gcc
Parents
rL263076: [Modules] Add stdatomic to the list of builtin headers
Branches
Unknown
Tags
Unknown