stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r532756 - /incubator/stdcxx/trunk/util/collate.cpp
Date Thu, 26 Apr 2007 14:23:15 GMT
Author: faridz
Date: Thu Apr 26 07:23:14 2007
New Revision: 532756

URL: http://svn.apache.org/viewvc?view=rev&rev=532756
Log:
2007-04-26 Farid Zaripov <Farid_Zaripov@epam.com>

	* collate.cpp (def::add_missing_values): Added checking of the
	iterator validity before use.

Modified:
    incubator/stdcxx/trunk/util/collate.cpp

Modified: incubator/stdcxx/trunk/util/collate.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/collate.cpp?view=diff&rev=532756&r1=532755&r2=532756
==============================================================================
--- incubator/stdcxx/trunk/util/collate.cpp (original)
+++ incubator/stdcxx/trunk/util/collate.cpp Thu Apr 26 07:23:14 2007
@@ -576,22 +576,27 @@
     for (symnames_it = charmap_.get_symnames_list ().begin ();
          symnames_it != charmap_.get_symnames_list ().end ();
          ++symnames_it) {
-        wchar_t wchar_val = (*w_cmap.find (*symnames_it)).second;
 
-        coll_map_iter coll_map_it;
-        if ((coll_map_it = coll_map_.find(wchar_val)) != coll_map_.end()) {
-            if (coll_map_it->second.offset == UINT_MAX) {
-                if (give_warning && !warning_issued) {
-                    warning_issued = true;
-                    warnings_occurred_ = 
-                        issue_diag (W_MISSING, false,
-                                    0, "some characters in the codeset "
-                                    "were not explicitly given a "
-                                    "collation value\n") || warnings_occurred_;
-                }
-                if (!collate_out_.undefined_optimization) {
-                    add_to_coll (wchar_val, weights_template, 
-                                 coll_value++, ordinal_weights, true);
+        std::map<std::string, wchar_t>::const_iterator w_cmap_it;
+        if ((w_cmap_it = w_cmap.find(*symnames_it)) != w_cmap.end()) {
+            wchar_t wchar_val = (*w_cmap_it).second;
+
+            coll_map_iter coll_map_it;
+            if ((coll_map_it = coll_map_.find(wchar_val)) != coll_map_.end()) {
+                if (coll_map_it->second.offset == UINT_MAX) {
+                    if (give_warning && !warning_issued) {
+                        warning_issued = true;
+                        warnings_occurred_ = 
+                            issue_diag (W_MISSING, false,
+                                        0, "some characters in the codeset "
+                                        "were not explicitly given a "
+                                        "collation value\n")
+                            || warnings_occurred_;
+                    }
+                    if (!collate_out_.undefined_optimization) {
+                        add_to_coll (wchar_val, weights_template, 
+                                     coll_value++, ordinal_weights, true);
+                    }
                 }
             }
         }



Mime
View raw message