# HG changeset patch # User Shohei KOKUBO # Date 1434442384 -32400 # Node ID 4e5b425922ce2bcfc0ce5ab6a07168c4bcf6f3d5 # Parent 8c709b714fb07749691b9f2e59aeb1c028a441c2 fix llrb diff -r 8c709b714fb0 -r 4e5b425922ce src/llrb/llrb.c --- a/src/llrb/llrb.c Tue Jun 16 13:40:26 2015 +0900 +++ b/src/llrb/llrb.c Tue Jun 16 17:13:04 2015 +0900 @@ -98,8 +98,8 @@ if (tree->root == 0) { context->next[context->current++] = Insert; } else { + context->next[context->current++] = Replace; context->next[context->current++] = Compare; - context->next[context->current++] = Replace; tree->current = tree->root; } goto meta(context, Allocator); @@ -129,8 +129,8 @@ stack_pop(pstack, &tree->current); context->next[context->current++] = Insert; } else { + context->next[context->current++] = Replace; context->next[context->current++] = Compare; - context->next[context->current++] = Replace; } goto meta(context, Allocator); @@ -298,14 +298,12 @@ puts("---before---"); print_tree(context->data[Tree]->tree.root, 0); - struct Allocate* allocate = &context->data[Allocate]->allocate; - allocate->size = sizeof(struct Node); - allocate->next = Code5; - struct Node* node = &context->data[Node]->node; node->key = 0; node->value = 0; + context->next[context->current++] = Code5; + goto meta(context, Put); }