A fix: make error_type usable as function type; prevents core dump on some inputs

This commit is contained in:
ceriel 1993-05-14 12:01:14 +00:00
parent b4aef1eb5e
commit 4d1b0d3486
2 changed files with 3 additions and 4 deletions

View file

@ -263,11 +263,9 @@ begin_proc(ds, idf) /* to be called when entering a procedure */
func_name = name;
if (def->df_type->tp_fund != FUNCTION) {
error("making function body for non-function");
func_type = error_type;
def->df_type = error_type;
}
else {
func_type = def->df_type->tp_up;
}
#ifdef LINT
func_notypegiven = ds->ds_notypegiven;
#endif

View file

@ -348,6 +348,7 @@ init()
lngdbl_type = standard_type(LNGDBL, 0, lngdbl_align, lngdbl_size);
void_type = standard_type(VOID, 0, 1, (arith)-1);
error_type = standard_type(ERRONEOUS, 0, 1, (arith)1);
error_type->tp_up = error_type;
/* Pointer Arithmetic type: all arithmetics concerning
pointers is supposed to be performed in the