From 52082c8190a3f68613aeb3a25eef95a7bc93d8ef Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Fri, 20 Aug 1999 08:01:30 +0200 Subject: [PATCH] Fixed the difference in type check between a["b"]=c and a->b=c. Rev: src/las.c:1.84 --- src/las.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/las.c b/src/las.c index 568f0a968f..2537ca5fc1 100644 --- a/src/las.c +++ b/src/las.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: las.c,v 1.83 1999/08/17 01:06:58 mast Exp $"); +RCSID("$Id: las.c,v 1.84 1999/08/20 06:01:30 mast Exp $"); #include "language.h" #include "interpret.h" @@ -1608,7 +1608,8 @@ void fix_type_field(node *n) case F_ASSIGN: if(CAR(n) && CDR(n) && - CDR(n)->token != F_ARROW && /* a->b=c can be valid when a is an array */ + /* a["b"]=c and a->b=c can be valid when a is an array */ + CDR(n)->token != F_INDEX && CDR(n)->token != F_ARROW && !match_types(CDR(n)->type,CAR(n)->type)) my_yyerror("Bad type in assignment."); copy_shared_string(n->type, CAR(n)->type); -- GitLab