Branch: Tag:

2014-08-23

2014-08-23 12:00:37 by Martin Nilsson <nilsson@opera.com>

While having lfun::cast as private WORKS JUST FINE, it also allows us to get rid of some argument checking. As protected we can't do that.

791:      static void stat_cast(INT32 args)   { -  struct pike_string *type = Pike_sp[-args].u.string; +  struct pike_string *type; +  +  if (!args) +  SIMPLE_TOO_FEW_ARGS_ERROR("Stat cast",1); +  if (TYPEOF(sp[-args]) != T_STRING) +  SIMPLE_BAD_ARG_ERROR("cast",1,"string"); +  +  type = Pike_sp[-args].u.string;    pop_stack(); /* type have at least one more reference. */       if (type == literal_array_string)