From 2fcda44ab081ec4425d6f54923109bfd5131bd57 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 23 Aug 2018 20:07:22 +0900 Subject: [PATCH] Kill dag leaf nodes on assignment. Fixes the failing swap test caused by a's original value being used (via t) after being written. --- tools/qfcc/source/dags.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/qfcc/source/dags.c b/tools/qfcc/source/dags.c index 95c99d10a..5daf3060e 100644 --- a/tools/qfcc/source/dags.c +++ b/tools/qfcc/source/dags.c @@ -475,6 +475,11 @@ dagnode_attach_label (dagnode_t *n, daglabel_t *l) internal_error (0, "attempt to attach non-identifer label to dagnode " "identifiers"); if (l->dagnode) { + // if the node is a leaf, then kill its value so no attempt is made + // to reuse it. + if (l->dagnode->type == st_none) { + l->dagnode->killed = 1; + } dagnode_t *node = l->dagnode; set_union (n->edges, node->parents); set_remove (n->edges, n->number);