mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[poincare] Temporary commit that handles nullptr nodes in References
This commit is contained in:
@@ -37,7 +37,7 @@ template<typename T>
|
||||
class Evaluation : public TreeByValue {
|
||||
public:
|
||||
EvaluationNode<T> * node() const override {
|
||||
assert(!TreeByValue::node()->isGhost());
|
||||
assert(TreeByValue::node() == nullptr || !TreeByValue::node()->isGhost());
|
||||
return static_cast<EvaluationNode<T> *>(TreeByValue::node());
|
||||
}
|
||||
Evaluation() : Evaluation(nullptr) {}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
/* Reference */
|
||||
ExpressionNode * node() const override {
|
||||
assert(!TreeByValue::node()->isGhost());
|
||||
assert(TreeByValue::node() == nullptr || !TreeByValue::node()->isGhost());
|
||||
return static_cast<ExpressionNode *>(TreeByValue::node());
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
}
|
||||
|
||||
LayoutNode * node() const override {
|
||||
assert(!TreeByReference::node()->isGhost());
|
||||
assert(TreeByReference::node() == nullptr || !TreeByReference::node()->isGhost());
|
||||
return static_cast<LayoutNode *>(TreeByReference::node());
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,9 @@ protected:
|
||||
TreeByReference() : m_identifier(-1) {}
|
||||
void setIdentifierAndRetain(int newId) {
|
||||
m_identifier = newId;
|
||||
node()->retain();
|
||||
if (isDefined()) {
|
||||
node()->retain();
|
||||
}
|
||||
}
|
||||
/* Hierarchy operations */
|
||||
// Add
|
||||
|
||||
Reference in New Issue
Block a user