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.
536
2003/11/
18
13
:
08
:
33
grubba Exp $
+
|| $Id: program.c,v 1.
537
2003/11/
19
20
:
23
:
03
grubba Exp $
*/ #include "global.h"
-
RCSID("$Id: program.c,v 1.
536
2003/11/
18
13
:
08
:
33
grubba Exp $");
+
RCSID("$Id: program.c,v 1.
537
2003/11/
19
20
:
23
:
03
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"
pike.git/src/program.c:2343:
if(p->strings) for(e=0; e<p->num_strings; e++) if(p->strings[e]) free_string(p->strings[e]); if(p->identifiers) { for(e=0; e<p->num_identifiers; e++) {
+
#ifdef PIKE_PORTABLE_BYTECODE
+
if (p->program &&
+
IDENTIFIER_IS_PIKE_FUNCTION(p->identifiers[e].identifier_flags) &&
+
p->identifiers[e].func.offset != -1) {
+
/* FIXME: What about LP64? */
+
struct pike_tripple *tripples =
+
((void **)(p->program+p->identifiers[e].func.offset))[-1];
+
fprintf(stderr, "Freeing tripples at 0x%08p.\n", tripples);
+
if (tripples)
+
free(tripples);
+
}
+
#endif /* PIKE_PORTABLE_BYTECODE */
if(p->identifiers[e].name) free_string(p->identifiers[e].name); if(p->identifiers[e].type) free_type(p->identifiers[e].type); } } if(p->constants) { for(e=0;e<p->num_constants;e++)
pike.git/src/program.c:7594:
/* FIXME: What if they aren't static & hidden in a? */ bid = ID_FROM_INT(b,e); if(s == bid->name) continue; /* Skip __INIT */ i = find_shared_string_identifier(bid->name,a); if (i == -1) { continue; /* It's ok... */ }
-
/* Note:
Use
weaker check for constant integers. */
+
/* Note:
Uses
weaker check for constant integers. */
if(((bid->run_time_type != PIKE_T_INT) || (ID_FROM_INT(a, i)->run_time_type != PIKE_T_INT)) && !match_types(ID_FROM_INT(a,i)->type, bid->type)) { #if 0 fprintf(stderr, "Identifier \"%s\" is incompatible.\n", bid->name->str); #endif /* 0 */ return 0; } }
pike.git/src/program.c:7701:
/* FIXME: What if they aren't static & hidden in a? */ bid = ID_FROM_INT(b,e); if(s == bid->name) continue; /* Skip __INIT */ i = find_shared_string_identifier(bid->name,a); if (i == -1) { continue; /* It's ok... */ }
-
/* Note:
Use
weaker check for constant integers. */
+
/* Note:
Uses
weaker check for constant integers. */
if(((bid->run_time_type != PIKE_T_INT) || (ID_FROM_INT(a, i)->run_time_type != PIKE_T_INT)) && !match_types(ID_FROM_INT(a,i)->type, bid->type)) { if (flags & YYTE_IS_WARNING) yywarning("Identifier \"%s\" is incompatible.", bid->name->str); else my_yyerror("Identifier \"%s\" is incompatible.", bid->name->str); yytype_error(NULL, ID_FROM_INT(a,i)->type, bid->type, flags);
pike.git/src/program.c:7743:
if (b->identifier_references[e].id_flags & (ID_OPTIONAL)) continue; /* It's ok... */ if(flags & YYTE_IS_WARNING) yywarning("Missing identifier \"%s\".", bid->name->str); else my_yyerror("Missing identifier \"%s\".", bid->name->str); return 0; } if (!pike_types_le(bid->type, ID_FROM_INT(a, i)->type)) {
-
struct pike_string *s1,*s2;
-
s1=describe_type(ID_FROM_INT(a,i)->type);
-
s2=describe_type(bid->type);
+
if(!match_types(ID_FROM_INT(a,i)->type, bid->type)) { my_yyerror("Type of identifier \"%s\" does not match.", bid->name->str);
-
my
_
yyerror
(
"Expected: %s"
,
s1->str);
-
my
_
yyerror
(
"Got : %s"
,
s2
->
str
);
+
yytype
_
error
(
NULL
,
ID
_
FROM_INT
(
a
,
i)
->
type, bid->type, 0
);
} else { yywarning("Type of identifier \"%s\" is not strictly compatible.", bid->name->str);
-
yywarning
(
"Expected:
%s"
,
s1
->
str);
-
yywarning("Got : %s"
,
s2
->
str
);
+
yytype_error
(
NULL,
ID_FROM_INT(a
,
i)
->
type,
bid
->
type, YYTE_IS_WARNING
);
}
-
free_string(s1);
-
free_string(s2);
+
return 0; } } return 1; } PMOD_EXPORT void *parent_storage(int depth) { struct external_variable_context loc; struct program *p;