Branch: Tag:

2002-06-07

2002-06-07 17:45:49 by Martin Nilsson <mani@lysator.liu.se>

Stricter type checking for index lvalues.

Rev: src/las.c:1.294

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.293 2002/06/06 16:26:00 mast Exp $"); + RCSID("$Id: las.c,v 1.294 2002/06/07 17:45:49 nilsson Exp $");      #include "language.h"   #include "interpret.h"
3401:    free_string(t1);    }    /* FIXME: check_soft_cast() is weaker than pike_types_le() -  * The resulting type should probably be the and between the old +  * The resulting type should probably be the AND between the old    * and the new type.    */    }
3442:    fix_type_field(CDR(n));    if (!pike_types_le(CAR(n)->type, CDR(n)->type)) {    /* a["b"]=c and a->b=c can be valid when a is an array */ -  if (CDR(n)->token != F_INDEX && -  CDR(n)->token != F_ARROW && +  if (((CDR(n)->token != F_INDEX && +  CDR(n)->token != F_ARROW) || +  !match_types(array_type_string, CDR(n)->type)) &&    !match_types(CDR(n)->type,CAR(n)->type)) {    yytype_error("Bad type in assignment.",    CDR(n)->type, CAR(n)->type, 0);