summaryrefslogtreecommitdiff
path: root/src/synthesis.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-05-04 19:00:05 -0400
committerAdrian Thurston <thurston@colm.net>2018-05-04 19:00:05 -0400
commita6436943ef56e70e1b18ce72a3f6aa5bf88cff7b (patch)
treee7944ef031e5e26dc9fcf1fcb3159606783dd65a /src/synthesis.cc
parent0be8f4f4a0245fa4659364670d9b073fac9d2210 (diff)
downloadcolm-a6436943ef56e70e1b18ce72a3f6aa5bf88cff7b.tar.gz
don't downref values of void type
Diffstat (limited to 'src/synthesis.cc')
-rw-r--r--src/synthesis.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/synthesis.cc b/src/synthesis.cc
index a54719de..b7b50515 100644
--- a/src/synthesis.cc
+++ b/src/synthesis.cc
@@ -1574,7 +1574,7 @@ UniqueType *LangTerm::evaluateParse( Compiler *pd, CodeVect &code,
if ( ut->typeId == TYPE_TREE && ut->langEl == pd->voidLangEl ) {
/* Clear it away if return type is void. */
- code.append( IN_POP_TREE );
+ code.append( IN_POP_VAL );
continue;
}
@@ -1689,8 +1689,8 @@ void ConsItemList::evaluateSendStream( Compiler *pd, CodeVect &code )
UniqueType *ut = item->expr->evaluate( pd, code );
if ( ut->typeId == TYPE_TREE && ut->langEl == pd->voidLangEl ) {
/* Clear it away if the the return type is void. */
- code.append( IN_POP_TREE );
- code.append( IN_POP_TREE );
+ code.append( IN_POP_VAL );
+ code.append( IN_POP_VAL );
continue;
}
else if ( ut->typeId == TYPE_TREE && !isStr( ut ) ) {
@@ -1757,7 +1757,7 @@ void LangTerm::evaluateSendParser( Compiler *pd, CodeVect &code, bool strings )
UniqueType *ut = item->expr->evaluate( pd, code );
if ( ut->typeId == TYPE_TREE && ut->langEl == pd->voidLangEl ) {
/* Clear it away if return type is void. */
- code.append( IN_POP_TREE );
+ code.append( IN_POP_VAL );
continue;
}
@@ -2648,7 +2648,7 @@ void LangStmt::compile( Compiler *pd, CodeVect &code ) const
case ExprType: {
/* Evaluate the exrepssion, then pop it immediately. */
UniqueType *exprUt = expr->evaluate( pd, code );
- if ( exprUt->tree() )
+ if ( exprUt->tree() && exprUt->langEl != pd->voidLangEl )
code.append( IN_POP_TREE );
else
code.append( IN_POP_VAL );