diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-01-23 15:20:24 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-01-23 16:32:52 +0100 |
commit | 09109f3dcde24fcd13426ce5b77bb40032f58947 (patch) | |
tree | dbfe86231331ce17352db7856b266c15879db6ec /connectivity | |
parent | 22fef9910ecfcbbd7bd4c4c8268be2c4b4a5a96a (diff) |
OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookup
Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/parse/sqlbison.y | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index 96d078291d5f..a0f7d43fe9af 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; } //----------------------------------------------------------------------------- |