--- parser3/src/main/execute.C 2001/02/25 14:23:32 1.43 +++ parser3/src/main/execute.C 2001/02/25 16:08:26 1.44.2.1 @@ -1,5 +1,5 @@ /* - $Id: execute.C,v 1.43 2001/02/25 14:23:32 paf Exp $ + $Id: execute.C,v 1.44.2.1 2001/02/25 16:08:26 paf Exp $ */ #include "pa_array.h" @@ -98,7 +98,7 @@ void Request::execute(const Array& ops) dump(1, *local_ops); Junction& j=*NEW Junction(pool(), *self, - 0, + 0,0, root,rcontext,wcontext,local_ops); Value *value=NEW VJunction(j); @@ -239,10 +239,17 @@ void Request::execute(const Array& ops) self=NEW VObject(pool(), *called_class); frame->write(self); } else { // no - // static or dynamic call - self=&frame->junction.self; + // is it my class or my parent's class? + VClass *read_class=rcontext->get_class(); + if(read_class && read_class->is_or_derived_from(*called_class)) // yes + self=rcontext; // class dynamic call + else // no + self=&frame->junction.self; // static or simple dynamic call } frame->set_self(self); + // temporary substituting self's class .CLASS to + // that class it's called AS + Temp_class_alias(*self, *frame->junction.vclass); root=rcontext=wcontext=frame; execute(frame->junction.method->code);