Select Git revision
apply_low.h
apply_low.h 9.01 KiB
/*
|| 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.
*/
{
struct program *p;
struct reference *ref;
struct pike_frame *new_frame;
struct identifier *function;
#if 0
/* This kind of fault tolerance is braindamaged. /mast */
if(fun<0)
{
pop_n_elems(Pike_sp-save_sp);
push_undefined();
return 0;
}
#else
#ifdef PIKE_DEBUG
if (fun < 0)
Pike_fatal ("Invalid function offset: %d.\n", fun);
#endif
#endif
check_stack(256);
check_mark_stack(256);
#ifdef PIKE_DEBUG
{
static int counter;
switch(d_flag)
{
case 0:
case 1:
case 2:
break;
case 3:
if(!((counter++ & 7)))
do_debug();
break;
case 4:
default:
do_debug();
}
}
#endif
p=o->prog;
if(!p)
PIKE_ERROR("destructed object->function",
"Cannot call functions in destructed objects.\n", Pike_sp, args);
if(!(p->flags & PROGRAM_PASS_1_DONE) || (p->flags & PROGRAM_AVOID_CHECK))
PIKE_ERROR("__empty_program() -> function",
"Cannot call functions in unfinished objects.\n", Pike_sp, args);
#ifdef PIKE_SECURITY
CHECK_DATA_SECURITY_OR_ERROR(o, SECURITY_BIT_CALL,
("Function call permission denied.\n"));
if(!CHECK_DATA_SECURITY(o, SECURITY_BIT_NOT_SETUID))
SET_CURRENT_CREDS(o->prot);
#endif
#ifdef PIKE_DEBUG