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.
610
2006
/
10
/
27
18:
45
:
00
grubba Exp $
+
|| $Id: program.c,v 1.
611
2007
/
01
/
16
18:
22
:
41
grubba 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:2272:
init_type_stack(); #define PUSH #include "compilation.h" Pike_compiler->compiler_pass = pass; Pike_compiler->num_used_modules=0;
-
if(p
&& (p
->flags & PROGRAM_FINISHED)
)
+
if(p->flags & PROGRAM_FINISHED)
{ yyerror("Pass2: Program already done");
-
p=0;
+
} Pike_compiler->malloc_size_program = ALLOC_STRUCT(program); Pike_compiler->fake_object=alloc_object(); #ifdef PIKE_DEBUG Pike_compiler->fake_object->storage=(char *)xalloc(256 * sizeof(struct svalue)); /* Stipple to find illegal accesses */ MEMSET(Pike_compiler->fake_object->storage,0x55,256*sizeof(struct svalue)); #else
pike.git/src/program.c:4997:
if (!match_types(type, gs_type)) { my_yyerror("Type mismatch for callback function %S:", name); yytype_error(NULL, gs_type, type, 0); } else if (lex.pragmas & ID_STRICT_TYPES) { yywarning("Type mismatch for callback function %S:", name); yytype_error(NULL, gs_type, type, YYTE_IS_WARNING); } } i = isidentifier(symbol); if ((i >= 0) &&
-
!((ref = Pike_compiler->new_program
->identifier_references
+
i)->
+
!((ref =
PTR_FROM_INT(
Pike_compiler->new_program
,
i)
)
->
id_flags & ID_INHERITED)) { /* Not an inherited symbol. */ struct identifier *id = ID_FROM_INT(Pike_compiler->new_program, i); if (!IDENTIFIER_IS_VARIABLE(id->identifier_flags)) { my_yyerror("Illegal to redefine function %S with variable.", symbol); getter_setter_offset = -1; } else if (id->run_time_type != PIKE_T_GET_SET) { my_yyerror("Illegal to redefine a current variable with a getter/setter: %S.", symbol); getter_setter_offset = -1; } else { if (ref->id_flags != flags) { if (Pike_compiler->compiler_pass == 1) { yywarning("Modifier mismatch for variable %S.", symbol); } ref->id_flags &= flags; } getter_setter_offset += id->func.offset; }
-
+
/* FIXME: Update id->type here. */
} else { INT32 offset = Pike_compiler->new_program->num_program; getter_setter_offset += offset; /* Get/set information. * reference number to getter. * reference number to setter. * NOTE: Only place-holders for now. * The proper entry gets set when we have added the function. */ ins_pointer(-1); ins_pointer(-1); low_define_variable(symbol, symbol_type, flags, offset, PIKE_T_GET_SET); }
-
/*
FIXME
:
Really
ought
to
be
ID_HIDDEN
too,
-
*
but
that
complicates
matters
below
.
..
+
/*
NOTE
:
The
function
needs
to
have
the
same PRIVATE/INLINE
+
*
behaviour
as
the
variable
for
overloading to behave
+
* as expected
.
+
*
+
* FIXME: Force PRIVATE?
*/
-
flags = ID_STATIC
|ID_PRIVATE|ID_INLINE
;
+
flags
|
= ID_STATIC;
free_type(symbol_type); free_string(symbol); } } if(IDENTIFIER_IS_C_FUNCTION(function_flags)) Pike_compiler->new_program->flags |= PROGRAM_HAS_C_METHODS; if (Pike_compiler->compiler_pass == 1) { /* Mark the type as tentative by reusing IDENTIFIER_C_FUNCTION.