mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare/expression] Return undef if simplification interrupted
Without this change, we would get weird "reduced" expression, such as multiplication(undef, _s), but we do not always check sSimplificationHasBeenInterrupted afterwards.
This commit is contained in:
committed by
EmilieNumworks
parent
5c75cc55d3
commit
f3628f368f
@@ -817,7 +817,11 @@ Expression Expression::angleUnitToRadian(Preferences::AngleUnit angleUnit) {
|
||||
|
||||
Expression Expression::reduce(ExpressionNode::ReductionContext reductionContext) {
|
||||
sSimplificationHasBeenInterrupted = false;
|
||||
return deepReduce(reductionContext);
|
||||
Expression result = deepReduce(reductionContext);
|
||||
if (sSimplificationHasBeenInterrupted) {
|
||||
return replaceWithUndefinedInPlace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Expression Expression::deepReduce(ExpressionNode::ReductionContext reductionContext) {
|
||||
|
||||
Reference in New Issue
Block a user