Skip to content

Commit 3ee9f4f

Browse files
committed
address comments, fix ICU error callback
1 parent cfd8e5d commit 3ee9f4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Support/CharSet.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ enum ConversionType {
8484
// possible because EBCDIC 1047 is a single-byte, stateless encoding; other
8585
// character sets are not supported.
8686
class CharSetConverterTable : public details::CharSetConverterImplBase {
87-
ConversionType ConvType;
87+
const ConversionType ConvType;
8888

8989
public:
9090
CharSetConverterTable(ConversionType ConvType) : ConvType(ConvType) {}
@@ -149,8 +149,9 @@ CharSetConverterICU::convertString(StringRef Source,
149149

150150
ucnv_setToUCallBack(&*FromConvDesc, UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL,
151151
&EC);
152-
ucnv_setToUCallBack(&*ToConvDesc, UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL,
153-
&EC);
152+
ucnv_setFromUCallBack(&*ToConvDesc, UCNV_FROM_U_CALLBACK_STOP, NULL, NULL,
153+
NULL, &EC);
154+
assert(U_SUCCESS(EC));
154155

155156
do {
156157
EC = U_ZERO_ERROR;

0 commit comments

Comments
 (0)