From c4dddae6566edc2035bda078929e26fd32ea4e21 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 19 Aug 2009 18:23:32 -0700 Subject: [PATCH] Give a more exact error for dereferencing void* * dwflpp.cxx (dwflpp::translate_components): Check for void* deref. --- dwflpp.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dwflpp.cxx b/dwflpp.cxx index 780a3510b..6593e5a73 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -1713,6 +1713,12 @@ dwflpp::translate_components(struct obstack *pool, break; case DW_TAG_pointer_type: + /* A pointer with no type is a void* -- can't dereference it. */ + if (!dwarf_hasattr_integrate (die, DW_AT_type)) + throw semantic_error ("invalid access '" + lex_cast(c) + + "' vs. " + dwarf_type_name(die), + c.tok); + c_translate_pointer (pool, 1, 0 /* PR9768*/, die, tail); if (c.type != target_symbol::comp_literal_array_index && c.type != target_symbol::comp_expression_array_index) -- 2.43.5