Branch: Tag:

2002-12-10

2002-12-10 16:53:28 by Martin Stjernholm <mast@lysator.liu.se>

Added checks for placeholder objects and programs to narrow down problems in
the pike side of the resolver better.

Rev: src/cpp.c:1.113
Rev: src/las.c:1.317
Rev: src/program.c:1.467

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.316 2002/12/09 22:20:09 mast Exp $ + || $Id: las.c,v 1.317 2002/12/10 16:53:28 mast Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.316 2002/12/09 22:20:09 mast Exp $"); + RCSID("$Id: las.c,v 1.317 2002/12/10 16:53:28 mast Exp $");      #include "language.h"   #include "interpret.h"
1863:       case T_OBJECT:    case T_PROGRAM: - #if 1 +     if(!(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE))    {    struct program *p;
1885: Inside #if 1
   }    }    } - #endif +        default:    {
1954:    free_svalue(&thrown);    }    } +  +  else if ((Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE) && +  ((Pike_sp[-1].type == T_OBJECT && +  Pike_sp[-1].u.object == placeholder_object) || +  (Pike_sp[-1].type == T_PROGRAM && +  Pike_sp[-1].u.program == placeholder_program)) && +  /* Ugly special case: We must be able to get +  * predef::__placeholder_object. */ +  (!node_name || strcmp (node_name, "predef"))) { +  if (node_name) +  my_yyerror("Got placeholder %s (resolver problem) " +  "when indexing module '%s' with '%s'.", +  get_name_of_type (Pike_sp[-1].type), +  node_name, id->str); +  else +  my_yyerror("Got placeholder %s (resolver problem) " +  "when indexing a module with '%s'.", +  get_name_of_type (Pike_sp[-1].type), +  id->str);    } -  +  }    END_CYCLIC();    }    }