Chromium Code Reviews

Side by Side Diff: source/i18n/rbt_data.cpp

Issue 6676011: Coverity INFINITE_LOOP Fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/icu46/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ********************************************************************** 2 **********************************************************************
3 * Copyright (C) 1999-2008, International Business Machines 3 * Copyright (C) 1999-2008, International Business Machines
4 * Corporation and others. All Rights Reserved. 4 * Corporation and others. All Rights Reserved.
5 ********************************************************************** 5 **********************************************************************
6 * Date Name Description 6 * Date Name Description
7 * 11/17/99 aliu Creation. 7 * 11/17/99 aliu Creation.
8 ********************************************************************** 8 **********************************************************************
9 */ 9 */
10 10
(...skipping 54 matching lines...)
65 for (i=0; i<variablesLength; ++i) { 65 for (i=0; i<variablesLength; ++i) {
66 variables[i] = other.variables[i]->clone(); 66 variables[i] = other.variables[i]->clone();
67 if (variables[i] == NULL) { 67 if (variables[i] == NULL) {
68 status = U_MEMORY_ALLOCATION_ERROR; 68 status = U_MEMORY_ALLOCATION_ERROR;
69 break; 69 break;
70 } 70 }
71 } 71 }
72 } 72 }
73 // Remove the array and exit if memory allocation error occured. 73 // Remove the array and exit if memory allocation error occured.
74 if (U_FAILURE(status)) { 74 if (U_FAILURE(status)) {
75 for (int32_t n = i-1; n >= 0; n++) { 75 for (int32_t n = i-1; n >= 0; n--) {
76 delete variables[n]; 76 delete variables[n];
77 } 77 }
78 uprv_free(variables); 78 uprv_free(variables);
79 variables = NULL; 79 variables = NULL;
80 return; 80 return;
81 } 81 }
82 82
83 // Do this last, _after_ setting up variables[]. 83 // Do this last, _after_ setting up variables[].
84 ruleSet.setData(this); // ruleSet must already be frozen 84 ruleSet.setData(this); // ruleSet must already be frozen
85 } 85 }
(...skipping 22 matching lines...)
108 UnicodeReplacer* 108 UnicodeReplacer*
109 TransliterationRuleData::lookupReplacer(UChar32 standIn) const { 109 TransliterationRuleData::lookupReplacer(UChar32 standIn) const {
110 UnicodeFunctor *f = lookup(standIn); 110 UnicodeFunctor *f = lookup(standIn);
111 return (f != 0) ? f->toReplacer() : 0; 111 return (f != 0) ? f->toReplacer() : 0;
112 } 112 }
113 113
114 114
115 U_NAMESPACE_END 115 U_NAMESPACE_END
116 116
117 #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 117 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine