pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || 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.438 2009/10/11 17:19:13 grubba Exp $ + || $Id: las.c,v 1.439 2009/11/09 17:17:45 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:1474:    yyerror("Failed to evaluate constant expression.");    }    } else {    yyerror("Expected constant expression.");    }    push_int(0);    return;    }    }    -  i=ID_FROM_INT(p, numid); +  i = ID_FROM_INT(p, numid);       /* Warning:    * This code doesn't produce function pointers for class constants,    * which can be harmful...    * /Hubbe    */ -  +  +  if (IDENTIFIER_IS_ALIAS(i->identifier_flags)) { +  struct external_variable_context loc; +  +  loc.o = Pike_compiler->fake_object; +  do { +  loc.inherit = INHERIT_FROM_INT(p, numid); +  loc.parent_identifier = 0; +  +  find_external_context(&loc, i->func.ext_ref.depth); +  numid = i->func.ext_ref.id; +  p = loc.o->prog; +  i = ID_FROM_INT(p, numid); +  } while (IDENTIFIER_IS_ALIAS(i->identifier_flags)); +  }    if(IDENTIFIER_IS_CONSTANT(i->identifier_flags))    {    if(i->func.offset != -1)    {    push_svalue(&PROG_FROM_INT(p, numid)->constants[i->func.offset].sval);    }else{    if(Pike_compiler->compiler_pass!=1)    yyerror("Constant is not defined yet.");    push_int(0);    } -  }else{ +  } else {    my_yyerror("Identifier %S is not a constant", i->name);    push_int(0);    }    }   }      /* Leaves a function or object on the stack */   void resolv_class(node *n)   {    check_tree(n,0);