Replace nodes with AllocationFailures inside the tree when needed

This commit is contained in:
Léa Saviot
2018-06-29 14:21:10 +02:00
parent cb77fbe2ff
commit 2684b2f09f
15 changed files with 139 additions and 83 deletions

View File

@@ -2,12 +2,12 @@
#include "allocation_failed_expression_node.h"
template<>
TreeNode * ExpressionRef::failedAllocationNode() {
TreeNode * ExpressionRef::staticFailedAllocationStaticNode() {
static AllocationFailedExpressionRef FailureRef;
return FailureRef.node();
}
template<>
ExpressionReference<ExpressionNode> ExpressionRef::failedAllocationRef() {
return ExpressionReference<ExpressionNode>(failedAllocationNode());
ExpressionReference<ExpressionNode> ExpressionRef::staticFailedAllocationStaticRef() {
return ExpressionReference<ExpressionNode>(staticFailedAllocationStaticNode());
}