[poincare/multiplication] Return Undef early

Multiplication::privateShallowReduce can create an Undef node by
multiplying 0 and inf. In this case, we set the whole multiplication to
undef, to avoid things such as undef*π.
This fixes the following bug :
  - In Graph, enter i*inf*π as one of the bounds. An assertion fails in
    Multiplication::removeUnit.

Change-Id: Ie9d0d561d6e310f52220b98541f22a4b5e56762c
This commit is contained in:
Gabriel Ozouf
2020-08-17 12:11:25 +02:00
committed by Émilie Feral
parent aa14a6a82e
commit 206013f2db

View File

@@ -778,6 +778,9 @@ Expression Multiplication::privateShallowReduce(ExpressionNode::ReductionContext
SetInterruption(true);
return *this;
}
if (m.isUndefined()) {
return replaceWithUndefinedInPlace();
}
replaceChildAtIndexInPlace(0, m);
removeChildAtIndexInPlace(i);
} else {