summaryrefslogtreecommitdiff
path: root/src/iter.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-03-29 19:27:34 -0400
committerAdrian Thurston <thurston@complang.org>2015-03-29 19:27:34 -0400
commit2d8123e782deb1f4d9a3412b37eacc545fb8053e (patch)
treef3a87b11084bccd1a4afdcf96af00c265c69f09d /src/iter.c
parent49b347705e29596edb6e091b855e021601e854c5 (diff)
downloadcolm-2d8123e782deb1f4d9a3412b37eacc545fb8053e.tar.gz
use contiguous space on caller stack for args
This change will allow us to remove the complicated contiguous computation and instruction before a call. It simplifies the call procedure and will also make stack unwinding simpler.
Diffstat (limited to 'src/iter.c')
-rw-r--r--src/iter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/iter.c b/src/iter.c
index b30248b0..888fb3fd 100644
--- a/src/iter.c
+++ b/src/iter.c
@@ -267,7 +267,6 @@ void userIterDestroy( Program *prg, Tree ***psp, UserIter *uiter )
vm_popn( uiter->yieldSize );
vm_popn( sizeof(UserIter) / sizeof(Word) );
- vm_popn( argSize );
uiter->type = 0;
@@ -289,9 +288,14 @@ void userIterDestroy2( Program *prg, Tree ***psp, UserIter *uiter )
vm_popn( uiter->yieldSize );
vm_popn( sizeof(UserIter) / sizeof(Word) );
- vm_popn( argSize );
+
+ /* Contiguous push. */
vm_pop_tree();
+ /* The IN_PREP_ARGS stack data. */
+ vm_popn( argSize );
+ vm_pop_value();
+
uiter->type = 0;
*psp = sp;