summaryrefslogtreecommitdiff
path: root/src/pdarun.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2021-01-03 20:41:50 -0800
committerAdrian Thurston <thurston@colm.net>2021-01-03 22:11:06 -0800
commit0887c4d577545e47820df4389b5be81fe2fee0c3 (patch)
tree4abe26a3c20ab24611be339d03b4ecff17d0f570 /src/pdarun.c
parentc086031208751d26f09d6177e6bb82923dc852fa (diff)
downloadcolm-0887c4d577545e47820df4389b5be81fe2fee0c3.tar.gz
various refcount fixes
- added downref when undoing a tree push - using correct opcode for undoing pushing stream - added an upref when sending back ignored trees
Diffstat (limited to 'src/pdarun.c')
-rw-r--r--src/pdarun.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pdarun.c b/src/pdarun.c
index f1885ec6..c958273e 100644
--- a/src/pdarun.c
+++ b/src/pdarun.c
@@ -180,8 +180,10 @@ static void send_back_ignore( program_t *prg, tree_t **sp,
int artificial = parse_tree->flags & PF_ARTIFICIAL;
if ( head != 0 ) {
- if ( artificial )
+ if ( artificial ) {
+ colm_tree_upref( prg, parse_tree->shadow->tree );
send_back_tree( prg, is, parse_tree->shadow->tree );
+ }
else
send_back_text( prg, is, colm_alph_from_cstr( string_data( head ) ), head->length );
}
@@ -240,7 +242,6 @@ static void send_back( program_t *prg, tree_t **sp, struct pda_run *pda_run,
}
colm_tree_upref( prg, parse_tree->shadow->tree );
-
send_back_tree( prg, is, parse_tree->shadow->tree );
}
else {