Subject: Re: front end 1.61

From: Zheng Gengbin <[email-masked]>
Date: Wed, 9 Oct 1996 10:57:48 +0800 (EAT)

On Tue, 8 Oct 1996, Guansong Zhang wrote:

> Please check the following line in util.c (line 706, 709), what if
> type->entry.kind_decl.kindexp==NULL ?
> 
> This cause a segment fault on my machine. Please get rid of this bug.
> 
> This happen when dbx run in testh.dep with the following.
> 
> (dbx) print *type
> (variant = 586, id = 79, length = 0, thread = (nil), name = (nil), ud_chain =
> (nil), entry = [union])
> 
> 
>

	I have tested if the type pointer is of T_KIND at the beginning of
the function . So if it is T_KIND , the type->entry.kind_decl.kindexp 
cannot be NULL , otherwise some bugs exist in hpf2dep or hpfsc .

	Here I attached a new version 1.61 of hpf2dep . It is based on the
version you mailed to me . This version cannot parse the ivp+.f in testhp,
while it can before.

> 
> /*   scalar type */
> int get_kind(type)
> PTR_TYPE type;
> {
>     PTR_LLND expr_list,kind_op;
> 
>     if (type->variant != T_KIND ) return -1;        /* default */
> 
>     expr_list=type->entry.kind_decl.kindexp->entry.Template.ll_ptr1;
> 
> -------------------------------------------------------------------------
>         for (;expr_list;expr_list=expr_list->entry.Template.ll_ptr2)
>         {
>                 if (expr_list->variant==KIND_OP)
> ================================================================
> 
>         {
>             kind_op=expr_list->entry.Template.ll_ptr1;
>             if ((kind_op->attr & GOT_KIND) ==0)
>             {
>                             comput_const_expr(kind_op,1);
>                 kind_op->attr |= GOT_KIND;
>             }
>             return kind_op->const_val;
>                 }
>         }
>     return -1;
> }
>

---

From: Zheng Gengbin <[email-masked]>
Date: Wed, 9 Oct 1996 11:02:11 +0800 (EAT)

This is the new verison of hpfsc .

Zheng