diff mbox series

[4/4] typeof: examine it at show-time

Message ID 20191109133519.63010-5-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series clarify evaluation of SYM_TYPEOF | expand

Commit Message

Luc Van Oostenryck Nov. 9, 2019, 1:35 p.m. UTC
Unless an explicit call to examine_pointer_target() or
get_base_type() is made, the base type of pointers are
*not* examined via the usual recursive examine_symbol_type().
That means that it is possible to call show_typename()
on a non-fully examined type which is wrong (for example,
because SYM_TYPEOFs may not be converted).

So, call examine_pointer_target() on pointers when trying
to display them.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 show-parse.c              | 1 +
 validation/eval/typeof0.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/show-parse.c b/show-parse.c
index 371041675..80125e741 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -337,6 +337,7 @@  deeper:
 		mod = sym->ctype.modifiers;
 		as = sym->ctype.as;
 		was_ptr = 1;
+		examine_pointer_target(sym);
 		break;
 
 	case SYM_FN:
diff --git a/validation/eval/typeof0.c b/validation/eval/typeof0.c
index abef63865..12b086608 100644
--- a/validation/eval/typeof0.c
+++ b/validation/eval/typeof0.c
@@ -4,7 +4,6 @@  static typeof(i) *ptr;
 /*
  * check-name: eval-typeof0
  * check-command: test-show-type $file
- * check-known-to-fail
  *
  * check-output-ignore
  * check-output-excludes: unknown type