Permalink
Browse files

temporary fix, so t/fun.m1 runs fine

  • Loading branch information...
1 parent c74de6b commit 516d34c72e0c91c5fff327627b4a8e2adc41a8a8 Jimmy Zhuo committed Jun 9, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −1 src/m0/c/interp.c
  2. +4 −1 src/m0/c/ops.c
View
@@ -101,7 +101,7 @@ new_call_frame( M0_Interp *interp ) {
frame->registers[CHUNK] = (uint64_t)(*interp)[CHUNKS];
frame->registers[PC] = (uint64_t)0;
frame->registers[CONSTS] = (uint64_t)((M0_Chunk*) ((*interp)[CHUNKS]))->constants;
- frame->registers[CF] = (uint64_t)frame;
+ frame->registers[CF] = (uint64_t)frame;
frame->registers[INTERP] = (uint64_t)interp;
return frame;
View
@@ -264,7 +264,10 @@ m0_op_goto_chunk(M0_CallFrame *frame, const unsigned char *ops )
M0_Interp *interp = (M0_Interp *)frame->registers[INTERP];
M0_Chunk *chunk = (M0_Chunk*)((*interp)[CHUNKS]);
while(chunk) {
- if( strncmp( chunk->name, (char *)frame->registers[ops[1]], chunk->name_length) == 0) {
+ if(strncmp( chunk->name, (char *)frame->registers[ops[1]], chunk->name_length) == 0
+ /* XXX: temporary fix, so t/fun.m1 runs fine. */
+ || ( ((M0_Chunk *)(frame->registers[ops[1]]))->name
+ && strncmp( chunk->name, ((M0_Chunk *)(frame->registers[ops[1]]))->name, chunk->name_length ) == 0 )) {
frame->registers[CHUNK] = (uint64_t)chunk;
frame->registers[CONSTS] = (uint64_t)chunk->constants;
frame->registers[MDS] = (uint64_t)chunk->metadata;

0 comments on commit 516d34c

Please sign in to comment.