From: ceriel Date: Fri, 12 Jun 1992 09:03:07 +0000 (+0000) Subject: Fixed checking of unary '*' X-Git-Tag: release-5-5~469 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=09a80e9e13989678ca851f7d25e7bdf7c7f36067;p=ack.git Fixed checking of unary '*' --- diff --git a/lang/cem/cemcom.ansi/ch3mon.c b/lang/cem/cemcom.ansi/ch3mon.c index ebfb899ff..0148e006b 100644 --- a/lang/cem/cemcom.ansi/ch3mon.c +++ b/lang/cem/cemcom.ansi/ch3mon.c @@ -45,21 +45,26 @@ ch3mon(oper, expp) } else { 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)) /* dereference in administration only */ expr->ex_type = expr->ex_type->tp_up; else /* runtime code */ *expp = new_oper(expr->ex_type->tp_up, NILEXPR, '*', expr); - (*expp)->ex_lvalue = ( - (*expp)->ex_type->tp_fund != ARRAY && - (*expp)->ex_type->tp_fund != FUNCTION + expr = *expp; + expr->ex_lvalue = ( + expr->ex_type->tp_fund != ARRAY && + expr->ex_type->tp_fund != FUNCTION ); - if ((*expp)->ex_type->tp_typequal & TQ_CONST) - (*expp)->ex_flags |= EX_READONLY; - if ((*expp)->ex_type->tp_typequal & TQ_VOLATILE) - (*expp)->ex_flags |= EX_VOLATILE; - (*expp)->ex_flags &= ~EX_ILVALUE; + if (expr->ex_type->tp_typequal & TQ_CONST) + expr->ex_flags |= EX_READONLY; + if (expr->ex_type->tp_typequal & TQ_VOLATILE) + expr->ex_flags |= EX_VOLATILE; + expr->ex_flags &= ~EX_ILVALUE; } break; case ADDRESSOF: