diff --git a/ase/stx/interp.c b/ase/stx/interp.c index ba2c0619..1e37b254 100644 --- a/ase/stx/interp.c +++ b/ase/stx/interp.c @@ -1,5 +1,5 @@ /* - * $Id: interp.c,v 1.16 2005-09-30 12:19:00 bacon Exp $ + * $Id: interp.c,v 1.17 2005-10-01 05:33:06 bacon Exp $ */ #include @@ -153,14 +153,14 @@ static int __run_process (xp_stx_t* stx, process_t* proc) proc->stack[proc->stack_top++] = stx->nil; } else if (code == 0x6B) { - proc->stack[proc->stack_top++] = stx->true; + proc->stack[proc->stack_top++] = stx->true; } else if (code == 0x6C) { - proc->stack[proc->stack_top++] = stx->false; + proc->stack[proc->stack_top++] = stx->false; } else if (code == 0x6D) { /* push receiver */ - proc->stack[proc->stack_top++] = proc->receiver; + proc->stack[proc->stack_top++] = proc->receiver; } /* TODO: more here .... */ @@ -175,8 +175,8 @@ static int __run_process (xp_stx_t* stx, process_t* proc) else if (code == 0x71) { /* send to super */ next = proc->bytecodes[proc->pc++]; - //__send_to_super (stx, - // proc, next >> 5, proc->literals[next & 0x1F]); + //if (__send_to_super (stx, proc, + // next >> 5, proc->literals[next & 0x1F]) == -1) break; } else if (code == 0x72) { /* send to self extended */ @@ -194,6 +194,12 @@ static int __run_process (xp_stx_t* stx, process_t* proc) } /* more code .... */ + else if (code == 0x78) { + /* return receiver */ + proc->stack[proc->stack_top++] = proc->receiver; + if (__return_from_message (stx, proc) == -1) break; + } + else if (code == 0x7C) { /* return from message */ if (__return_from_message (stx, proc) == -1) break; @@ -204,6 +210,11 @@ static int __run_process (xp_stx_t* stx, process_t* proc) next = proc->bytecodes[proc->pc++]; __dispatch_primitive (stx, proc, ((code & 0x0F) << 8) | next); } + + else { +xp_printf (XP_TEXT("INVALID OPCODE...........\n")); +break; + } } return 0; diff --git a/ase/stx/parser.c b/ase/stx/parser.c index 1f991056..68858af5 100644 --- a/ase/stx/parser.c +++ b/ase/stx/parser.c @@ -1,5 +1,5 @@ /* - * $Id: parser.c,v 1.74 2005-09-30 16:49:39 bacon Exp $ + * $Id: parser.c,v 1.75 2005-10-01 05:33:06 bacon Exp $ */ #include @@ -780,7 +780,7 @@ static int __parse_statements (xp_stx_parser_t* parser) } } - EMIT_RETURN_FROM_MESSAGE (parser); + EMIT_CODE (parser, RETURN_RECEIVER); return 0; } diff --git a/ase/test/stx/test.st b/ase/test/stx/test.st index 6b8f670e..849a1c97 100644 --- a/ase/test/stx/test.st +++ b/ase/test/stx/test.st @@ -9,6 +9,6 @@ main a := #abc print: 123 and: 2345. #abc print: a and: a. - super print: a and: a. + "super print: a and: a." 1234567. ^nil.