Branch: Tag:

2007-09-25

2007-09-25 16:56:53 by Henrik Grubbström (Grubba) <grubba@grubba.org>

check_program() now knows something about extern symbols.

Rev: src/program.c:1.620

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: program.c,v 1.619 2007/09/24 19:18:24 grubba Exp $ + || $Id: program.c,v 1.620 2007/09/25 16:56:53 grubba Exp $   */      #include "global.h"
3067:    (p->identifiers[e].run_time_type!=PIKE_T_GET_SET))    check_type(p->identifiers[e].run_time_type);    +  if (!IDENTIFIER_IS_EXTERN(p->identifiers[e].identifier_flags)) {    if(IDENTIFIER_IS_VARIABLE(p->identifiers[e].identifier_flags))    {    if( (p->identifiers[e].func.offset /* + OFFSETOF(object,storage)*/ ) &
3077:    PTRDIFF_T_TO_LONG(p->identifiers[e].func.offset));    }    } +  } else { +  /* FIXME: Check that ext_ref.depth and ext_ref.id are valid and +  * have matching identifier_flags. +  */ +  if (!(p->flags & PROGRAM_USES_PARENT)) { +  Pike_fatal("Identifier %d is an external reference, but " +  "PROGRAM_USES_PARENT hasn't been set.\n", +  e);    } -  +  } +  }       for(e=0;e<p->num_identifier_references;e++)    {