[PATCH 2/4] typeof: do not let classify_type() do its own SYM_TYPEOF expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SYM_TYPEOFs are expanded at examination type.
However, classify_type() does its own expansion of SYM_TYPEOFs.
Worse, it does this differently (address space & noderef are
not removed)..

So, to enforce the same expansion, also use examine_symbol_type()
to do the expansion in classify_type().

Note: it's not sure that it's currently possible to have
      SYM_TYPEOFs to expand in classify_type().

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 evaluate.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index 539ef8038587..038fd64ace9e 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -383,10 +383,8 @@ static inline int classify_type(struct symbol *type, struct symbol **base)
 	if (type->type == SYM_NODE)
 		type = type->ctype.base_type;
 	if (type->type == SYM_TYPEOF) {
-		type = evaluate_expression(type->initializer);
-		if (!type)
-			type = &bad_ctype;
-		else if (type->type == SYM_NODE)
+		type = examine_symbol_type(type);
+		if (type->type == SYM_NODE)
 			type = type->ctype.base_type;
 	}
 	if (type->type == SYM_ENUM)
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux