From c56d19fe9c03f3c45741aa0a5aa91da4aedf3398 Mon Sep 17 00:00:00 2001 From: Adrian Thurston Date: Thu, 30 Aug 2012 12:32:25 -0400 Subject: an extra call to vm_contiguous in the rev triter Makes all tests pass under vm stack size = 1. --- colm/bytecode.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'colm/bytecode.c') 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; } -- cgit v1.2.1