summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-08-19 18:23:32 -0700
committerJosh Stone <jistone@redhat.com>2009-08-19 18:23:32 -0700
commitc4dddae6566edc2035bda078929e26fd32ea4e21 (patch)
tree64511f78bda1db9841452ee4e0c543d6330d211b /dwflpp.cxx
parent72c5ecc2fffe43146eaf54284cf9626b7f76cb78 (diff)
downloadsystemtap-steved-c4dddae6566edc2035bda078929e26fd32ea4e21.tar.gz
systemtap-steved-c4dddae6566edc2035bda078929e26fd32ea4e21.tar.xz
systemtap-steved-c4dddae6566edc2035bda078929e26fd32ea4e21.zip
Give a more exact error for dereferencing void*
* dwflpp.cxx (dwflpp::translate_components): Check for void* deref.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 780a3510..6593e5a7 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<string>(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)