[poincare] Prevent Bad access on abstract symbol context

Change-Id: I3077db5fdc2430ee11ceb1c6eb651e4331fb2ba0
This commit is contained in:
Hugo Saint-Vignes
2020-11-16 14:41:33 +01:00
committed by EmilieNumworks
parent 41778433b1
commit a0497d3bd7

View File

@@ -73,6 +73,11 @@ Expression SymbolAbstract::Expand(const SymbolAbstract & symbol, Context * conte
{
return clone ? symbol.clone() : *const_cast<SymbolAbstract *>(&symbol);
}
if (context == nullptr) {
// A context is required
assert(false);
return Undefined::Builder();
}
Expression e = context->expressionForSymbolAbstract(symbol, clone);
/* Replace all the symbols iteratively. This prevents a memory failure when
* symbols are defined circularly. */