summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-23 16:39:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-24 09:24:53 +0100
commitbec28033628473bdfde0c5a9e1af522613968051 (patch)
tree159e16975a1f1751aafd9c6c1eca8206e4dffaee /basic
parentdc4d6c59631c6a197a95e1b531babc6169c95907 (diff)
coverity#704558 Dereference after null check
Change-Id: I6fe44d8926acd185bb6bc671fb7df8ae935998c1
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/exprnode.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx
index e245fef19382..4340848bf66e 100644
--- a/basic/source/comp/exprnode.cxx
+++ b/basic/source/comp/exprnode.cxx
@@ -240,13 +240,12 @@ void SbiExprNode::CollectBits()
// If a twig can be converted, True will be returned. In this case
// the result is in the left twig.
-
void SbiExprNode::FoldConstants()
{
if( IsOperand() || eTok == LIKE ) return;
if( pLeft )
pLeft->FoldConstants();
- if( pRight )
+ if (pLeft && pRight)
{
pRight->FoldConstants();
if( pLeft->IsConstant() && pRight->IsConstant()
@@ -419,7 +418,7 @@ void SbiExprNode::FoldConstants()
}
}
}
- else if( pLeft && pLeft->IsNumber() )
+ else if (pLeft && pLeft->IsNumber())
{
nVal = pLeft->nVal;
delete pLeft;