[PATCH] Change in core[libreoffice-4-0]: OSQLParser::RuleIDToRule should not silently change s_aRever...

Lionel Elie Mamane (via Code Review) gerrit at gerrit.libreoffice.org
Wed Jan 23 07:36:28 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1826

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/1826/1

OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookup

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



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 @@
 //-----------------------------------------------------------------------------
 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 @@
 @section connectivity
 
 @li @c connectivity.mork
+ at li @c connectivity.parse
 
 @section cui
 

-- 
To view, visit https://gerrit.libreoffice.org/1826
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lionel at mamane.lu>



More information about the LibreOffice mailing list