fixed a bug with setjmp.
authorceriel <none@none>
Thu, 6 Aug 1987 14:19:06 +0000 (14:19 +0000)
committerceriel <none@none>
Thu, 6 Aug 1987 14:19:06 +0000 (14:19 +0000)
Fixed a bug with non-struct pointers referring to structs

lang/cem/cemcom/ch7.c
lang/cem/cemcom/idf.c
lang/cem/cemcom/util.c

index c276a82..d0997df 100644 (file)
@@ -41,7 +41,9 @@ ch7sel(expp, oper, idf)
        exp = *expp;
        tp = exp->ex_type;
        if (oper == ARROW)      {
-               if (tp->tp_fund == POINTER)     /* normal case */
+               if (tp->tp_fund == POINTER &&
+                   ( tp->tp_up->tp_fund == STRUCT ||
+                     tp->tp_up->tp_fund == UNION))     /* normal case */
                        tp = tp->tp_up;
                else {  /* constructions like "12->selector" and
                                "char c; c->selector"
@@ -54,6 +56,8 @@ ch7sel(expp, oper, idf)
                                sd = idf2sdef(idf, tp);
                                tp = sd->sd_stype;
                                break;
+                       case POINTER:
+                               break;
                        default:
                                expr_error(exp, "-> applied to %s",
                                        symbol2str(tp->tp_fund));
@@ -61,7 +65,7 @@ ch7sel(expp, oper, idf)
                                exp->ex_type = error_type;
                                return;
                        }
-               } /* tp->tp_fund != POINTER */
+               }
        } /* oper == ARROW */
        else { /* oper == '.' */
                /* filter out illegal expressions "non_lvalue.sel" */
index 4512dba..15b3c83 100644 (file)
@@ -34,7 +34,7 @@ int idfsize = IDFSIZE;
 extern char options[];
 extern arith NewLocal();
 
-char sp_occurred[SP_TOTAL];    /* indicate occurrence of special id    */
+char sp_occurred[SP_TOTAL+1];  /* indicate occurrence of special id    */
 
 struct idf *idf_hashtable[HASHSIZE];
        /*      All identifiers can in principle be reached through
index c41cda4..0c04408 100644 (file)
@@ -136,9 +136,11 @@ LocalFinish()
                }
                regs[i] = 0;
        }
+       if (! options['n']) {
+               C_mes_begin(ms_reg);
+               C_mes_end();
+       }
 #ifdef USE_TMP
-       C_mes_begin(ms_reg);
-       C_mes_end();
        C_endpart(loc_id);
 #endif
 }