[poincare] Fix Ceiling::shallowReduce that added uninitialized nodes

This commit is contained in:
Léa Saviot
2018-09-17 11:45:06 +02:00
parent be25848578
commit 7f4e76424d

View File

@@ -54,8 +54,11 @@ Expression Ceiling::shallowReduce(Context & context, Preferences::AngleUnit angl
if (s.name() == Ion::Charset::Exponential) {
result = Rational(3);
}
replaceWithInPlace(result);
return result;
if (!result.isUninitialized()) {
replaceWithInPlace(result);
return result;
}
return *this;
}
if (c.type() != ExpressionNode::Type::Rational) {
return *this;