Resolves: tdf#136364 treat svSep type with ocUnion as range type
So for RPN
sv...Ref(ocPush), sv...Ref(ocPush), svSep(ocUnion), sv...Ref(ocPush)
another svSep(ocUnion) instead of svSep(ocSep) is appended.
Regression from
commit a6032ff541
CommitDate: Thu Oct 11 11:26:37 2018 +0200
Resolves: tdf#90698 catch list (1;2) of non-references as error
that introduced a conditional check on operands and operators.
Change-Id: If5da3a781f24f891ff12c4a8f32a2ec92c6b4c8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102276
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
This commit is contained in:
@@ -305,7 +305,7 @@ bool isRangeResultOpCode( OpCode eOp )
|
|||||||
@param bRight
|
@param bRight
|
||||||
If bRPN==false, bRight==false means opcodes for left side are
|
If bRPN==false, bRight==false means opcodes for left side are
|
||||||
checked, bRight==true means opcodes for right side. If bRPN==true
|
checked, bRight==true means opcodes for right side. If bRPN==true
|
||||||
it doesn't matter.
|
it doesn't matter except for the ocSep converted to ocUnion case.
|
||||||
*/
|
*/
|
||||||
bool isPotentialRangeType( FormulaToken const * pToken, bool bRPN, bool bRight )
|
bool isPotentialRangeType( FormulaToken const * pToken, bool bRPN, bool bRight )
|
||||||
{
|
{
|
||||||
@@ -326,6 +326,10 @@ bool isPotentialRangeType( FormulaToken const * pToken, bool bRPN, bool bRight )
|
|||||||
case svExternalDoubleRef:
|
case svExternalDoubleRef:
|
||||||
case svExternalName: // could be range
|
case svExternalName: // could be range
|
||||||
return true;
|
return true;
|
||||||
|
case svSep:
|
||||||
|
// A special case if a previous ocSep was converted to ocUnion it
|
||||||
|
// stays svSep instead of svByte.
|
||||||
|
return bRPN && !bRight && pToken->GetOpCode() == ocUnion;
|
||||||
default:
|
default:
|
||||||
// Separators are not part of RPN and right opcodes need to be
|
// Separators are not part of RPN and right opcodes need to be
|
||||||
// other StackVar types or functions and thus svByte.
|
// other StackVar types or functions and thus svByte.
|
||||||
@@ -1407,6 +1411,7 @@ void FormulaCompiler::Factor()
|
|||||||
if (p && isPotentialRangeType( p, true, true))
|
if (p && isPotentialRangeType( p, true, true))
|
||||||
{
|
{
|
||||||
pFacToken->NewOpCode( ocUnion, FormulaToken::PrivateAccess());
|
pFacToken->NewOpCode( ocUnion, FormulaToken::PrivateAccess());
|
||||||
|
// XXX NOTE: the token's eType is still svSep here!
|
||||||
PutCode( pFacToken);
|
PutCode( pFacToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user