Branch: Tag:

2002-04-12

2002-04-12 22:53:00 by Martin Stjernholm <mast@lysator.liu.se>

Make a function pointer from this_program when possible, so it can be
used to create objects even when the class has a parent pointer.

Rev: src/program.c:1.412

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.411 2002/04/09 10:33:56 mast Exp $"); + RCSID("$Id: program.c,v 1.412 2002/04/12 22:53:00 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
995:       /* Handle this_program */    if (ident == this_program_string) { +  if (compilation_depth > 0) +  return mkexternalnode(Pike_compiler->previous->new_program, +  Pike_compiler->previous->parent_identifier); +  else {    struct svalue s;    s.type=T_PROGRAM;    s.u.program=Pike_compiler->new_program;    return mkconstantsvaluenode(&s);    } -  +  }    /* Handle UNDEFINED */    if (ident == UNDEFINED_string) {    struct svalue s;
1502:    if(idp) *idp=id;       CDFPRINTF((stderr, "th(%ld) %p low_start_new_program() %s " -  "pass=%d: threads_disabled:%d, compilation_depth:%d\n", +  "pass=%d: threads_disabled:%d, compilation_depth:%d %d\n",    (long)th_self(), p, name ? name->str : "-",    Pike_compiler->compiler_pass, -  threads_disabled, compilation_depth)); +  threads_disabled, compilation_depth, id));       init_type_stack();