pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
1999-12-11
1999-12-11 23:36:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>
b62ab0ecef5f3af9cabd5fa6ac40b0de21fae0cb (
23
lines) (+
20
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
Now fixes the type for this_object().
Rev: src/builtin_functions.c:1.222
5:
\*/ /**/ #include "global.h"
-
RCSID("$Id: builtin_functions.c,v 1.
221
1999/12/
09
01
:
53
:
56
grubba Exp $");
+
RCSID("$Id: builtin_functions.c,v 1.
222
1999/12/
11
23
:
36
:
46
grubba Exp $");
#include "interpret.h" #include "svalue.h" #include "pike_macros.h"
1269:
} }
+
node *fix_this_object_type(node *n)
+
{
+
free_string(n->type);
+
type_stack_mark();
+
push_type_int(new_program->id);
+
push_type(1); /* We are rather sure that we contain ourselves... */
+
push_type(T_OBJECT);
+
n->type = pop_unfinished_type();
+
if (n->parent) {
+
n->parent->node_info |= OPT_TYPE_NOT_FIXED;
+
}
+
return NULL;
+
}
+
void f_throw(INT32 args) { if(args < 1)
5446:
tOr3(tFunc(tOr(tStr,tArray),tArr(tInt)), tFunc(tOr(tMap(tSetvar(1,tMix),tMix),tSet(tSetvar(1,tMix))), tArr(tVar(1))),
-
tFunc(tOr(tObj,tPrg),tArr(tStr))),OPT_TRY_OPTIMIZE,fix_indices_type,0);
+
tFunc(tOr(tObj,tPrg),tArr(tStr))),
+
OPT_TRY_OPTIMIZE,fix_indices_type,0);
/* function(mixed:int) */ ADD_EFUN("intp", f_intp,tFunc(tMix,tInt),OPT_TRY_OPTIMIZE);
5566:
ADD_EFUN("stringp", f_stringp,tFunc(tMix,tInt),0); /* function(:object) */
-
ADD_
EFUN
("this_object", f_this_object,tFunc(tNone,tObj),OPT_EXTERNAL_DEPEND);
+
ADD_
EFUN2
("this_object", f_this_object,tFunc(tNone,tObj),
+
OPT_EXTERNAL_DEPEND
, fix_this_object_type, 0
);
/* function(mixed:void) */ ADD_EFUN("throw",f_throw,tFunc(tMix,tVoid),OPT_SIDE_EFFECT);