# HG changeset patch # User atton # Date 1466061590 0 # Node ID 56ea709e7af3dbba0d738f08908683063e260f8f # Parent 81717f43ea007f4165c69d59f51ea6aa996388dc Fix SEGV diff -r 81717f43ea00 -r 56ea709e7af3 src/insert_verification/akashaLLRBContext.c --- a/src/insert_verification/akashaLLRBContext.c Mon Jun 13 16:30:30 2016 +0900 +++ b/src/insert_verification/akashaLLRBContext.c Thu Jun 16 07:19:50 2016 +0000 @@ -58,7 +58,7 @@ __code initIteratorElem(struct Context* context, struct Allocate* allocate, struct IterElem* prev); __code initLLRBContext(struct Context* context, enum Code next) { - context->codeNum = Exit; + context->codeNum = CodeTerminal; context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; context->code = malloc(sizeof(__code*)*context->codeNum); @@ -110,7 +110,7 @@ context->data[AkashaInfo] = context->heap; context->heap += sizeof(struct AkashaInfo); - context->dataNum = AkashaInfo; + context->dataNum = UniqueDataTerminal; struct Tree* tree = &context->data[Tree]->tree; tree->root = 0; diff -r 81717f43ea00 -r 56ea709e7af3 src/insert_verification/include/akashaLLRBContext.h --- a/src/insert_verification/include/akashaLLRBContext.h Mon Jun 13 16:30:30 2016 +0900 +++ b/src/insert_verification/include/akashaLLRBContext.h Thu Jun 16 07:19:50 2016 +0000 @@ -49,6 +49,7 @@ DeleteCase5, DeleteCase6, Exit, + CodeTerminal }; enum Relational { @@ -63,6 +64,7 @@ Node, Iter, AkashaInfo, + UniqueDataTerminal }; struct Context { diff -r 81717f43ea00 -r 56ea709e7af3 src/insert_verification/main.c --- a/src/insert_verification/main.c Mon Jun 13 16:30:30 2016 +0900 +++ b/src/insert_verification/main.c Thu Jun 16 07:19:50 2016 +0000 @@ -100,10 +100,6 @@ goto showTrace(context, &context->data[Iter]->iterator); } -__code verifySpecification_stub(struct Context* context) { - goto verifySpecification(context, &context->data[Allocate]->allocate, &context->data[Tree]->tree, &context->data[AkashaInfo]->akashaInfo); -} - __code duplicateIterator_stub(struct Context* context) { goto duplicateIterator(context, &context->data[Allocate]->allocate, &context->data[Iter]->iterator); } diff -r 81717f43ea00 -r 56ea709e7af3 src/insert_verification/verifySpecification.c --- a/src/insert_verification/verifySpecification.c Mon Jun 13 16:30:30 2016 +0900 +++ b/src/insert_verification/verifySpecification.c Thu Jun 16 07:19:50 2016 +0000 @@ -1,6 +1,7 @@ #include #include "akashaLLRBContext.h" +extern __code meta(struct Context*, enum Code); extern void allocator(struct Context*); /* C functions (TODO: convert to code segment) */ @@ -162,6 +163,10 @@ goto getMaxHeight_stub(context); } +__code verifySpecification_stub(struct Context* context) { + goto verifySpecification(context, &context->data[Allocate]->allocate, &context->data[Tree]->tree, &context->data[AkashaInfo]->akashaInfo); +} + __code verifySpecification(struct Context* context, struct Allocate* allocate, struct Tree* tree, struct AkashaInfo* akashaInfo) { if (tree->root == NULL) { akashaInfo->minHeight = 1;