Skip to content

Commit bf6a38f

Browse files
committed
Temporary fix: ensure macros.unit is not deallocated inside of unitIsBaseUnit
1 parent 11227a8 commit bf6a38f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

icuSources/i18n/number_formatimpl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ NumberFormatterImpl::macrosToMicroGenerator(const MacroProps& macros, bool safe,
133133
// TODO: Accept currency symbols from DecimalFormatSymbols?
134134

135135
// Pre-compute a few values for efficiency.
136+
auto unit = macros.unit;
136137
bool isCurrency = utils::unitIsCurrency(macros.unit);
137-
bool isBaseUnit = utils::unitIsBaseUnit(macros.unit);
138+
bool isBaseUnit = utils::unitIsBaseUnit(unit);
138139
bool isPercent = utils::unitIsPercent(macros.unit);
139140
bool isPermille = utils::unitIsPermille(macros.unit);
140141
bool isCompactNotation = macros.notation.fType == Notation::NTN_COMPACT;

0 commit comments

Comments
 (0)