pike.git/src/program.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: program.c,v 1.563 2004/04/18 02:16:06 mast Exp $
+ || $Id: program.c,v 1.564 2004/05/29 18:13:41 grubba Exp $
*/
#include "global.h"
- RCSID("$Id: program.c,v 1.563 2004/04/18 02:16:06 mast Exp $");
+ RCSID("$Id: program.c,v 1.564 2004/05/29 18:13:41 grubba Exp $");
#include "program.h"
#include "object.h"
#include "dynamic_buffer.h"
#include "pike_types.h"
#include "stralloc.h"
#include "las.h"
- #include "language.h"
+
#include "lex.h"
#include "pike_macros.h"
#include "fsort.h"
#include "pike_error.h"
#include "docode.h"
#include "interpret.h"
#include "hashtable.h"
#include "main.h"
#include "pike_memory.h"
#include "gc.h"
pike.git/src/program.c:2373:
if(p->identifiers[e].type)
free_type(p->identifiers[e].type);
}
}
if(p->constants)
{
for(e=0;e<p->num_constants;e++)
{
free_svalue(& p->constants[e].sval);
+ #if 0
if(p->constants[e].name) free_string(p->constants[e].name);
-
+ #endif /* 0 */
}
}
if(p->inherits)
for(e=0; e<p->num_inherits; e++)
{
if(p->inherits[e].name)
free_string(p->inherits[e].name);
if(e)
{
pike.git/src/program.c:2666: Inside #if defined(PIKE_DEBUG)
fprintf(stderr, "%*s %4d: %5d\n",
indent, "",
d, p->variable_index[d]);
}
fprintf(stderr, "\n"
"%*sConstant table:\n"
"%*s ####: Type Name\n",
indent, "", indent, "");
for (d = 0; d < p->num_constants; d++) {
struct program_constant *c = p->constants + d;
+ #if 0
fprintf(stderr, "%*s %4d: %-15s %s%s%s\n",
indent, "",
d, get_name_of_type (c->sval.type),
c->name?"\"":"",c->name?c->name->str:"NULL",c->name?"\"":"");
-
+ #else /* !0 */
+ fprintf(stderr, "%*s %4d: %-15s %d\n",
+ indent, "",
+ d, get_name_of_type (c->sval.type),
+ c->offset);
+ #endif /* 0 */
}
fprintf(stderr, "\n"
"%*sLinenumber table:\n",
indent, "");
{
INT32 off = 0, line = 0;
char *cnt = p->linenumbers;
while (cnt < p->linenumbers + p->num_linenumbers) {
pike.git/src/program.c:2749: Inside #if defined(PIKE_DEBUG)
if(p->num_identifier_index > p->num_identifier_references)
Pike_fatal("Too many identifier index entries in program!\n");
for(e=0;e<p->num_constants;e++)
{
struct svalue *s = & p->constants[e].sval;
check_svalue(s);
if (p->flags & PROGRAM_FINISHED && s->type == T_OBJECT &&
s->u.object->next == s->u.object)
Pike_fatal ("Got fake object in constant in finished program.\n");
+ #if 0
if(p->constants[e].name) check_string(p->constants[e].name);
-
+ #else /* ! 0 */
+ if (p->constants[e].offset >= p->num_identifiers) {
+ Pike_fatal("Constant initializer outside num_identifiers (%d >= %d).\n",
+ p->constants[e].offset, p->num_identifiers);
}
-
+ #endif /* 0 */
+ }
for(e=0;e<p->num_strings;e++)
check_string(p->strings[e]);
for(e=0;e<p->num_inherits;e++)
{
if(!p->inherits[e].prog)
{
/* This inherit is not yet initialized, ignore rest of tests.. */
return;
pike.git/src/program.c:5199:
for(e=0;e<Pike_compiler->new_program->num_constants;e++)
{
JMP_BUF jmp;
if (SETJMP(jmp)) {
handle_compile_exception ("Error comparing constants.");
/* Assume that if `==() throws an error, the svalues aren't equal. */
}
else {
struct program_constant *c= Pike_compiler->new_program->constants+e;
- if(c->name == constant_name &&
- (equal ? is_equal(& c->sval,foo) : is_eq(& c->sval,foo)))
+ if((equal ? is_equal(& c->sval,foo) : is_eq(& c->sval,foo)))
{
UNSETJMP(jmp);
return e;
}
}
UNSETJMP(jmp);
}
assign_svalue_no_free(&tmp.sval,foo);
-
+ #if 0
if((tmp.name=constant_name)) add_ref(constant_name);
-
+ #else /* !0 */
+ tmp.offset = -1;
+ #endif /* 0 */
add_to_constants(tmp);
return e;
}
/*
* program examination functions available from Pike.
*/