diff options
author | Adrian Thurston <thurston@complang.org> | 2012-08-30 12:32:25 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-08-30 12:32:25 -0400 |
commit | c56d19fe9c03f3c45741aa0a5aa91da4aedf3398 (patch) | |
tree | d8f69596e84c659d2bb03ab4d2d1802833ff634c /colm/bytecode.c | |
parent | 2ccc9e526c44801af61d8e7c4b8e83b5653064ed (diff) | |
download | colm-c56d19fe9c03f3c45741aa0a5aa91da4aedf3398.tar.gz |
an extra call to vm_contiguous in the rev triter
Makes all tests pass under vm stack size = 1.
Diffstat (limited to 'colm/bytecode.c')
-rw-r--r-- | colm/bytecode.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/colm/bytecode.c b/colm/bytecode.c index 371bc296..f30a87ce 100644 --- a/colm/bytecode.c +++ b/colm/bytecode.c @@ -1895,14 +1895,21 @@ again: Ref rootRef; rootRef.kid = (Kid*)vm_pop(); rootRef.next = (Ref*)vm_pop(); + + int children = 0; + Kid *kid = treeChild( prg, rootRef.kid->tree ); + while ( kid != 0 ) { + children++; + kid = kid->next; + } + + vm_contiguous( children ); Tree **stackRoot = vm_ptop(); long rootSize = vm_ssize(); - int children = 0; - Kid *kid = treeChild( prg, rootRef.kid->tree ); + kid = treeChild( prg, rootRef.kid->tree ); while ( kid != 0 ) { - children++; vm_push( (SW) kid ); kid = kid->next; } |