From 30780ccadc7a49bc916d678f190a1916fcec51ce Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Thu, 11 Sep 2014 19:52:26 +0000 Subject: [PATCH] ICU-11032 call udata_getMemory() rather than reading internal structures X-SVN-Rev: 36473 --- icu4c/source/i18n/uspoof_impl.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/icu4c/source/i18n/uspoof_impl.cpp b/icu4c/source/i18n/uspoof_impl.cpp index ffb986cb624..9c662f80483 100644 --- a/icu4c/source/i18n/uspoof_impl.cpp +++ b/icu4c/source/i18n/uspoof_impl.cpp @@ -15,7 +15,6 @@ #include "cstring.h" #include "identifier_info.h" #include "scriptset.h" -#include "udatamem.h" #include "umutex.h" #include "udataswp.h" #include "uassert.h" @@ -531,10 +530,9 @@ SpoofData::SpoofData(UDataMemory *udm, UErrorCode &status) return; } fUDM = udm; - const DataHeader *dh = udm->pHeader; - int32_t headerSize = dh->dataHeader.headerSize; - fRawData = reinterpret_cast - ((char *)dh + headerSize); + // fRawData is non-const because it may be constructed by the data builder. + fRawData = reinterpret_cast( + const_cast(udata_getMemory(udm))); validateDataVersion(fRawData, status); initPtrs(status); } -- 2.40.0