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.747 2008/08/17 15:59:07 mast Exp $
+ || $Id: program.c,v 1.748 2008/08/17 16:22:41 mast Exp $
*/
#include "global.h"
#include "program.h"
#include "object.h"
#include "dynamic_buffer.h"
#include "pike_types.h"
#include "stralloc.h"
#include "las.h"
#include "lex.h"
pike.git/src/program.c:1545:
}
pop_stack();
return ret;
}
pop_stack();
}
}
UNSETJMP(tmp);
}
- /* fprintf(stderr,"***Undefined.\n"); */
+ #if 0 && defined (COMPILER_DEBUG)
+ safe_pike_fprintf (stderr, "Index %S: undefined\n", ident);
+ #endif
return 0;
}
struct node_s *resolve_identifier(struct pike_string *ident);
struct node_s *find_module_identifier(struct pike_string *ident,
int see_inherit)
{
struct compilation *c = THIS_COMPILATION;
pike.git/src/program.c:1642:
CHECK_COMPILER();
ref_push_string(ident);
ref_push_string(c->lex.current_file);
if (c->handler) {
ref_push_object(c->handler);
} else {
push_int(0);
}
if (!safe_apply_current2(PC_RESOLV_FUN_NUM, 3, NULL))
- handle_compile_exception ("Error resolving %S.", ident);
+ handle_compile_exception ("Error resolving '%S'.", ident);
-
+ if (Pike_compiler->compiler_pass != 2) {
+ /* If we get a program that hasn't gone through pass 1 yet then we
+ * have to register a dependency now in our pass 1 so that our
+ * pass 2 gets delayed. Otherwise the other program might still be
+ * just as unfinished when we come back here in pass 2. */
+ struct program *p = NULL;
+ if (Pike_sp[-1].type == T_PROGRAM)
+ p = Pike_sp[-1].u.program;
+ else if (Pike_sp[-1].type == T_OBJECT ||
+ (Pike_sp[-1].type == T_FUNCTION &&
+ Pike_sp[-1].subtype != FUNCTION_BUILTIN))
+ p = Pike_sp[-1].u.object->prog;
+ if (p && !(p->flags & PROGRAM_PASS_1_DONE))
+ report_compiler_dependency (p);
+ }
+
if (Pike_compiler->compiler_pass == 2 &&
((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))) {
my_yyerror("Got placeholder %s (resolver problem) "
- "when resolving %S.",
- get_name_of_type (Pike_sp[-1].type), ident->str);
+ "when resolving '%S'.",
+ get_name_of_type (Pike_sp[-1].type), ident);
} else {
if(!resolve_cache)
resolve_cache=dmalloc_touch(struct mapping *, allocate_mapping(10));
mapping_string_insert(resolve_cache,ident,Pike_sp-1);
if(!IS_UNDEFINED (Pike_sp-1))
{
ret=mkconstantsvaluenode(Pike_sp-1);
}
}
pike.git/src/program.c:2417:
struct identifier *i;
id=isidentifier(name);
if (id < 0)
Pike_fatal("Program constant disappeared in second pass.\n");
i=ID_FROM_INT(Pike_compiler->new_program, id);
free_type(i->type);
i->type=get_type_of_svalue(&tmp);
}
}
if (pass == 1) {
- if(c->compilation_depth >= 1)
+ if(c->compilation_depth >= 1) {
add_ref(p->parent = Pike_compiler->new_program);
-
+ debug_malloc_touch (p);
}
-
+ }
p->flags &=~ PROGRAM_VIRGIN;
if(idp) *idp=id;
CDFPRINTF((stderr, "th(%ld) %p low_start_new_program() %s "
"pass=%d: threads_disabled:%d, compilation_depth:%d\n",
(long)th_self(), p, name ? name->str : "-",
Pike_compiler->compiler_pass,
threads_disabled, c->compilation_depth));
init_type_stack();
pike.git/src/program.c:2484: Inside #if defined(PIKE_SECURITY)
#ifdef PIKE_SECURITY
Pike_compiler->fake_object->prot=0;
#endif
debug_malloc_touch(Pike_compiler->fake_object);
debug_malloc_touch(Pike_compiler->fake_object->storage);
if (Pike_compiler->fake_object->storage) {
if(name)
{
- /* Fake objects have parents regardless of PROGRAM_USE_PARENT */
+ /* Fake objects have parents regardless of PROGRAM_USES_PARENT */
if((((struct parent_info *)Pike_compiler->fake_object->storage)->parent=Pike_compiler->previous->fake_object))
add_ref(Pike_compiler->previous->fake_object);
((struct parent_info *)Pike_compiler->fake_object->storage)->parent_identifier=id;
}else{
((struct parent_info *)Pike_compiler->fake_object->storage)->parent=0;
((struct parent_info *)Pike_compiler->fake_object->storage)->parent_identifier=0;
}
}
Pike_compiler->new_program=p;