[poincare] Expression for undefined symbol returns Uninitialized

This commit is contained in:
Léa Saviot
2018-09-28 10:06:37 +02:00
committed by Émilie Feral
parent f71773bb8d
commit 2c8a8f02ee
2 changed files with 2 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ const char * GlobalContext::ExtensionForExpression(const Expression & exp) {
const Expression GlobalContext::ExpressionForRecord(const Ion::Storage::Record & record) {
if (record.isNull()) {
return Undefined();
return Expression();
}
// Build the Expression in the Tree Pool
return Expression(static_cast<ExpressionNode *>(TreePool::sharedPool()->copyTreeFromAddress(record.value().buffer, record.value().size)));

View File

@@ -190,7 +190,7 @@ bool Symbol::isRegressionSymbol(const char * c) {
bool Symbol::matches(ExpressionTest test, Context & context) const {
Expression e = context.expressionForSymbol(*this);
return test(e, context);
return !e.isUninitialized() && test(e, context);
}
Expression Symbol::shallowReduce(Context & context, Preferences::AngleUnit angleUnit) {