ICU-12572 Fixing undefined behavior in NullableValue assignment operator.
X-SVN-Rev: 41318
This commit is contained in:
parent
f1e1a5c3f4
commit
23bacf40c8
@ -246,7 +246,13 @@ class U_I18N_API NullableValue {
|
||||
fNull = false;
|
||||
}
|
||||
|
||||
NullableValue<T>& operator=(const NullableValue<T>& other) = default;
|
||||
NullableValue<T>& operator=(const NullableValue<T>& other) {
|
||||
fNull = other.fNull;
|
||||
if (!fNull) {
|
||||
fValue = other.fValue;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
NullableValue<T>& operator=(const T& other) {
|
||||
fValue = other;
|
||||
|
Loading…
Reference in New Issue
Block a user