From: ceriel Date: Tue, 15 May 1990 15:28:01 +0000 (+0000) Subject: the tp_sdef field of the type structure may only be used after checking tp_fund X-Git-Tag: release-5-5~1714 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0c6f2f490fe27700cd578440825263ececfca2e2;p=ack.git the tp_sdef field of the type structure may only be used after checking tp_fund --- diff --git a/lang/cem/cemcom.ansi/ch3.c b/lang/cem/cemcom.ansi/ch3.c index bfe03f15c..0b1d06297 100644 --- a/lang/cem/cemcom.ansi/ch3.c +++ b/lang/cem/cemcom.ansi/ch3.c @@ -571,11 +571,17 @@ int qual; ASSERT(tp); if (tp->tp_typequal & qual) return 1; - sdf = tp->tp_sdef; - while (sdf) { - if (recurqual(sdf->sd_type, qual)) - return 1; - sdf = sdf->sd_sdef; + switch(tp->tp_fund) { + case UNION: + case STRUCT: + case ENUM: + sdf = tp->tp_sdef; + while (sdf) { + if (recurqual(sdf->sd_type, qual)) + return 1; + sdf = sdf->sd_sdef; + } + break; } return 0; }