--- capa/capa51/pProj/capaGrammarDef.y 2000/08/23 16:55:12 1.14 +++ capa/capa51/pProj/capaGrammarDef.y 2000/09/20 17:21:01 1.16 @@ -250,7 +250,7 @@ statement : IDENTIFIER '=' calc_expr case IDENTIFIER: case I_VAR: case I_CONSTANT: case R_VAR: case R_CONSTANT: break; - case S_VAR: case S_CONSTANT: + case S_VAR: case S_CONSTANT: /* free up original used spaces */ capa_mfree($1->s_str); $1->s_str = NULL; break; default: break; } @@ -964,8 +964,11 @@ Symbol *name,*index;int free_symbols; key = (char *)capa_malloc(idx_len+leng,1); sprintf(key,"%s[%s]",name->s_name,tmp); - - a_p = find_arrayid(name->s_name); /* use the array name to search array tree */ + a_p = (Symbol *)NULL; + a_p = find_arrayid(name->s_name); /* use the array name to search array tree */ + if( a_p == NULL ) { + return NULL; + } /* did not check for error! */ s_p = find_array_by_index(a_p,key); /* use the index portion to search along array linked list */ capa_mfree((char *)tmp); capa_mfree((char *)key);