pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
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.
742
2008/08/
13
21
:
11
:
58
mast Exp $
+
|| $Id: program.c,v 1.
743
2008/08/
14
22
:
12
:
39
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:4210:
if(!p) { yyerror("Illegal program pointer."); return; } if (Pike_compiler->compiler_pass == 2) { struct program *old_p = Pike_compiler->new_program->inherits[Pike_compiler->num_inherits+1].prog; Pike_compiler->num_inherits += old_p->num_inherits;
+
if (old_p != p) {
-
yyerror("Got different program for inherit in second pass.");
+
yyerror("Got different program for inherit in second pass
"
+
"(resolver problem)
.");
}
-
+
+
if (!(p->flags & PROGRAM_FINISHED)) {
+
/* Require that the inherited program really is finished in pass
+
* 2. Otherwise we might not have all definitions when we
+
* fixate our program.
+
*
+
* FIXME: Maybe this can be relaxed by registering a dependency
+
* and delaying compilation here?
+
*/
+
yyerror ("Cannot inherit program in pass 2 "
+
"which is not fully compiled yet.");
+
yyerror ("(You probably have a cyclic symbol dependency that the "
+
"compiler cannot handle.)");
+
}
+
return; }
-
+
if (!(p->flags & (PROGRAM_FINISHED | PROGRAM_PASS_1_DONE))) {
+
yyerror ("Cannot inherit program in pass 1 "
+
"which is only a placeholder.");
+
yyerror ("(You probably have a cyclic symbol dependency that the "
+
"compiler cannot handle.)");
+
return;
+
}
+
#ifdef WITH_FACETS /* Check if inherit is a facet inherit. */ check_for_facet_inherit(p); #endif if (p == placeholder_program) { yyerror("Trying to inherit placeholder program (resolver problem)."); return; }
pike.git/src/program.c:4250:
Inside #if 0
*/ for(e=0;e<c->compilation_depth;e++,state=state->previous) state->new_program->flags |= PROGRAM_USES_PARENT; #endif } /* parent offset was increased by 42 for above test.. */ if(parent_offset) parent_offset-=42;
-
-
if(!(p->flags & (PROGRAM_FINISHED | PROGRAM_PASS_1_DONE)))
-
{
-
yyerror("Cannot inherit program which is not fully compiled yet.");
-
return;
-
}
-
+
inherit_offset = Pike_compiler->new_program->num_inherits; /* alignment magic */ storage_offset=p->inherits[0].storage_offset % p->alignment_needed; storage_offset=low_add_storage(STORAGE_NEEDED(p), p->alignment_needed, storage_offset); /* Without this, the inherit becomes skewed */ storage_offset-=p->inherits[0].storage_offset;