mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-22584 Fix def of nullptr
ICU-22584 fix
This commit is contained in:
parent
4da7ffaa36
commit
7d3cd7cba5
2 changed files with 10 additions and 5 deletions
|
@ -150,7 +150,7 @@ void RBBINode::NRDeleteNode(RBBINode *node) {
|
|||
|
||||
RBBINode *stopNode = node->fParent;
|
||||
RBBINode *nextNode = node;
|
||||
while (nextNode != stopNode) {
|
||||
while (nextNode != stopNode && nextNode != nullptr) {
|
||||
RBBINode *currentNode = nextNode;
|
||||
|
||||
if ((currentNode->fLeftChild == nullptr && currentNode->fRightChild == nullptr) ||
|
||||
|
@ -158,10 +158,12 @@ void RBBINode::NRDeleteNode(RBBINode *node) {
|
|||
currentNode->fType == setRef) { // own their children nodes.
|
||||
// CurrentNode is effectively a leaf node; it's safe to go ahead and delete it.
|
||||
nextNode = currentNode->fParent;
|
||||
if (nextNode->fLeftChild == currentNode) {
|
||||
nextNode->fLeftChild = nullptr;
|
||||
} else if (nextNode->fRightChild == currentNode) {
|
||||
nextNode->fRightChild = nullptr;
|
||||
if (nextNode) {
|
||||
if (nextNode->fLeftChild == currentNode) {
|
||||
nextNode->fLeftChild = nullptr;
|
||||
} else if (nextNode->fRightChild == currentNode) {
|
||||
nextNode->fRightChild = nullptr;
|
||||
}
|
||||
}
|
||||
delete currentNode;
|
||||
} else if (currentNode->fLeftChild) {
|
||||
|
|
|
@ -5872,6 +5872,9 @@ void RBBITest::TestBug22584() {
|
|||
UErrorCode ec {U_ZERO_ERROR};
|
||||
|
||||
RuleBasedBreakIterator bi(ruleStr, pe, ec);
|
||||
ec = U_ZERO_ERROR;
|
||||
ruleStr = u"a/b;c";
|
||||
RuleBasedBreakIterator bi2(ruleStr, pe, ec);
|
||||
}
|
||||
|
||||
void RBBITest::TestBug22581() {
|
||||
|
|
Loading…
Add table
Reference in a new issue