Fixed a few bugs

This commit is contained in:
ceriel
1990-10-31 15:56:51 +00:00
parent 162c1c81e9
commit 9aee9cb62f
7 changed files with 48 additions and 12 deletions

View File

@@ -158,7 +158,7 @@ convert(pbuf, psize, ptp, tp, size)
malloc_succeeded(*pbuf);
}
if ((*ptp)->ty_class == T_SUBRANGE) *ptp = (*ptp)->ty_base;
switch((*ptp)->ty_class) {
if (tp && *ptp) switch((*ptp)->ty_class) {
case T_INTEGER:
case T_UNSIGNED:
case T_POINTER:
@@ -1154,6 +1154,12 @@ eval_expr(p, pbuf, psize, ptp)
}
*psize = 0;
}
else {
if ((*ptp)->ty_class == T_CROSS) {
*ptp = (*ptp)->ty_cross;
if (! *ptp) *ptp = void_type;
}
}
return retval;
}
@@ -1222,5 +1228,17 @@ eval_desig(p, paddr, psize, ptp)
if (! retval) {
*psize = 0;
}
else {
if ((*ptp)->ty_class == T_CROSS) {
*ptp = (*ptp)->ty_cross;
if (! *ptp) {
*ptp = void_type;
print_node(p, 0);
fputs(" designator has unknown type\n", db_out);
retval = 0;
*psize = 0;
}
}
}
return retval;
}