mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[poincare] VariableContext::expressionForSymbol returns a clone of its
kept value to unable any modification of its value (without calling setExpressionForSymbol). All contexts::expressionForSymbol return new Expression that can be tempered with.
This commit is contained in:
@@ -31,7 +31,7 @@ void VariableContext::setExpressionForSymbol(const Expression & expression, cons
|
||||
|
||||
const Expression VariableContext::expressionForSymbol(const SymbolAbstract & symbol) {
|
||||
if (strcmp(symbol.name(), m_name) == 0) {
|
||||
return m_value;
|
||||
return m_value.clone();
|
||||
} else {
|
||||
return m_parentContext->expressionForSymbol(symbol);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user