[Sequences] Fixed a few crashes

Change-Id: Ib929bbae0f9ca06409706336ff799075e1288694
This commit is contained in:
Arthur Camouseigt
2020-09-17 11:43:27 +02:00
committed by Émilie Feral
parent 26bbdead7d
commit 960335c330
7 changed files with 60 additions and 16 deletions

View File

@@ -97,9 +97,12 @@ Expression Sequence::replaceSymbolWithExpression(const SymbolAbstract & symbol,
}
Expression Sequence::shallowReduce(ExpressionNode::ReductionContext reductionContext) {
if (reductionContext.symbolicComputation() == ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithUndefined
|| childAtIndex(0).isUndefined())
{
Expression e = Expression::defaultShallowReduce();
e = e.defaultHandleUnitsInChildren();
if (e.isUndefined()) {
return e;
}
if (reductionContext.symbolicComputation() == ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithUndefined) {
return replaceWithUndefinedInPlace();
}
return *this;