From ab35ba70b41a06cfd3d2bb92da0c34ccf9420fc1 Mon Sep 17 00:00:00 2001 From: Andrew Sidwell Date: Thu, 10 Jul 2008 14:29:53 +0000 Subject: Reset current_table properly after shuffling the stack. svn path=/trunk/hubbub/; revision=4570 --- src/treebuilder/in_body.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/treebuilder/in_body.c b/src/treebuilder/in_body.c index 3658ebe..31df8fd 100644 --- a/src/treebuilder/in_body.c +++ b/src/treebuilder/in_body.c @@ -1685,6 +1685,16 @@ void aa_remove_element_stack_item(hubbub_treebuilder *treebuilder, /* Now, shuffle the stack up one, removing node in the process */ memmove(&stack[index], &stack[index + 1], (limit - index) * sizeof(element_context)); + + uint32_t t; + + /* Set current_table again properly */ + for (t = treebuilder->context.current_node; t != 0; t--) { + if (stack[t].type == TABLE) + break; + } + + treebuilder->context.current_table = t; } /** -- cgit v1.2.3