mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 14:31:31 +00:00
ICU-20797 fix UBS compilation error and UBS in test code
Two issues here: - fix 2 build issue in i18n when compiling with clang++ -fsanitize=undefined the following two symbols were not exported (and they should be): typeinfo for icu::CollationCacheEntry typeinfo for icu::numparse::impl::CodePointMatcher - remove undefined behavior warning in NumberFormatTestTuple.. minor, but very annoying when repeated many times during every test run. Tends to mask real errors. > numberformattesttuple.cpp:319:5: runtime error: member access within null pointer of type 'NumberFormatTestTuple'
This commit is contained in:
parent
f63a8bb4e7
commit
cb8e278ee6
3 changed files with 5 additions and 3 deletions
|
@ -92,7 +92,7 @@ private:
|
|||
CollationTailoring(const CollationTailoring &other);
|
||||
};
|
||||
|
||||
struct CollationCacheEntry : public SharedObject {
|
||||
struct U_I18N_API CollationCacheEntry : public SharedObject {
|
||||
CollationCacheEntry(const Locale &loc, const CollationTailoring *t)
|
||||
: validLocale(loc), tailoring(t) {
|
||||
if(t != NULL) {
|
||||
|
|
|
@ -28,7 +28,7 @@ using ::icu::number::impl::TokenConsumer;
|
|||
using ::icu::number::impl::CurrencySymbols;
|
||||
|
||||
|
||||
class CodePointMatcher : public NumberParseMatcher, public UMemory {
|
||||
class U_I18N_API CodePointMatcher : public NumberParseMatcher, public UMemory {
|
||||
public:
|
||||
CodePointMatcher() = default; // WARNING: Leaves the object in an unusable state
|
||||
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
#include "cstring.h"
|
||||
#include "cmemory.h"
|
||||
|
||||
static NumberFormatTestTuple *gNullPtr = NULL;
|
||||
static NumberFormatTestTuple emptyObject;
|
||||
|
||||
static NumberFormatTestTuple *gNullPtr = &emptyObject;
|
||||
|
||||
#define FIELD_OFFSET(fieldName) ((int32_t) (((char *) &gNullPtr->fieldName) - ((char *) gNullPtr)))
|
||||
#define FIELD_FLAG_OFFSET(fieldName) ((int32_t) (((char *) &gNullPtr->fieldName##Flag) - ((char *) gNullPtr)))
|
||||
|
|
Loading…
Add table
Reference in a new issue