Branch: Tag:

2008-05-08

2008-05-08 10:07:39 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed handling of voidable types in new_check_call() et al in 7.6 compat mode.
Fixed leak of function continuation in strict-types mode.

Rev: src/pike_types.c:1.328

2:   || 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: pike_types.c,v 1.327 2008/05/06 15:28:26 grubba Exp $ + || $Id: pike_types.c,v 1.328 2008/05/08 10:07:39 grubba Exp $   */      #include "global.h"
5949: Inside #if defined(PIKE_DEBUG)
   fprintf(stderr, ".\n");    }   #endif /* PIKE_DEBUG */ +  /* No need to parform advanced checking in the trivial case... */ +  if (arg_type != fun_type->car) { +  if ((flags & CALL_7_6) && (arg_type == void_type_string)) { +  /* Compat with Pike 7.6 and earlier. */ +  arg_type = zero_type_string; +  } +     if (!low_pike_types_le(arg_type, tmp2 = fun_type->car, 0, 0) &&    ((flags & CALL_STRICT) ||    !low_match_types(arg_type, tmp2, NO_SHORTCUTS))) {
5962:    if (tmp) free_type(tmp);    break;    } +  }    /* Match. */    if (fun_type->type == PIKE_T_FUNCTION) {    /* Advance to the next argument. */
6116:    }    if (!(tmp2 = low_new_check_call(fun_type, arg_type->cdr, flags, sval))) {    if (flags & CALL_STRICT) { +  free_type(tmp);    return NULL;    }    return tmp;