Fixed checking of unary '*'

This commit is contained in:
ceriel 1992-06-12 09:03:07 +00:00
parent b7b797674f
commit 09a80e9e13

View file

@ -45,21 +45,26 @@ ch3mon(oper, expp)
} else { } else {
expr = *expp; expr = *expp;
if (expr->ex_type->tp_up->tp_fund != FUNCTION &&
expr->ex_type->tp_up->tp_size <= 0) {
expr_error(expr, "incomplete type in expression");
}
if (is_ld_cst(expr)) if (is_ld_cst(expr))
/* dereference in administration only */ /* dereference in administration only */
expr->ex_type = expr->ex_type->tp_up; expr->ex_type = expr->ex_type->tp_up;
else /* runtime code */ else /* runtime code */
*expp = new_oper(expr->ex_type->tp_up, NILEXPR, *expp = new_oper(expr->ex_type->tp_up, NILEXPR,
'*', expr); '*', expr);
(*expp)->ex_lvalue = ( expr = *expp;
(*expp)->ex_type->tp_fund != ARRAY && expr->ex_lvalue = (
(*expp)->ex_type->tp_fund != FUNCTION expr->ex_type->tp_fund != ARRAY &&
expr->ex_type->tp_fund != FUNCTION
); );
if ((*expp)->ex_type->tp_typequal & TQ_CONST) if (expr->ex_type->tp_typequal & TQ_CONST)
(*expp)->ex_flags |= EX_READONLY; expr->ex_flags |= EX_READONLY;
if ((*expp)->ex_type->tp_typequal & TQ_VOLATILE) if (expr->ex_type->tp_typequal & TQ_VOLATILE)
(*expp)->ex_flags |= EX_VOLATILE; expr->ex_flags |= EX_VOLATILE;
(*expp)->ex_flags &= ~EX_ILVALUE; expr->ex_flags &= ~EX_ILVALUE;
} }
break; break;
case ADDRESSOF: case ADDRESSOF: