connectivity/source/parse/sqlbison.y |   13 ++++++++++++-
 sal/inc/sal/log-areas.dox            |    1 +
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit e7827d556c302965af352b186a5cec86b548cf2a
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Jan 23 15:20:24 2013 +0100

    OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookup
    
    Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04
    Reviewed-on: https://gerrit.libreoffice.org/1826
    Reviewed-by: Miklos Vajna <vmik...@suse.cz>
    Tested-by: Miklos Vajna <vmik...@suse.cz>

diff --git a/connectivity/source/parse/sqlbison.y 
b/connectivity/source/parse/sqlbison.y
index 96d0782..a0f7d43 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4772,7 +4772,18 @@ sal_uInt32 OSQLParser::StrToRuleID(const ::rtl::OString 
& rValue)
 //-----------------------------------------------------------------------------
 OSQLParseNode::Rule OSQLParser::RuleIDToRule( sal_uInt32 _nRule )
 {
-    return s_aReverseRuleIDLookup[ _nRule ];
+    OSQLParser::RuleIDMap::const_iterator i 
(s_aReverseRuleIDLookup.find(_nRule));
+    if (i == s_aReverseRuleIDLookup.end())
+    {
+        SAL_WARN("connectivity.parse",
+                "connectivity::OSQLParser::RuleIDToRule cannot reverse-lookup 
rule. "
+                "Reverse mapping incomplete? "
+                "_nRule='" << _nRule << "' "
+                "yytname[_nRule]='" << yytname[_nRule] << "'");
+        return OSQLParseNode::UNKNOWN_RULE;
+    }
+    else
+        return i->second;
 }
 
 //-----------------------------------------------------------------------------
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index c167267..b5fa6f9 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -37,6 +37,7 @@ certain functionality.
 @section connectivity
 
 @li @c connectivity.mork
+@li @c connectivity.parse
 
 @section cui
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to