ICU4C: UnicodeSet constructor and assignment operator should setToBogus when OOM occurs

Description

Some of the UnicodeSet constructors methods don't take an error code parameter, meaning that if an OOM error occurs during the constructor, it will not reported back to the caller, and the caller has no way to know that the object is in a half-constructed state.

Similar with the assignment operator (operator=), if OOM occurs then there is no way to know that the object that was supposed to be assigned to is now in bad state.

Note: There is already precedent for marking the set as bogus when OOM happens. For example, in the constructor below, if uprv_malloc fails then it marks the set as "bogus".

Assignee

Jeff Genovy

Reporter

Jeff Genovy

Components

Labels

Reviewer

Steven R. Loomis

Priority

medium

Time Needed

None

Fix versions

Configure