]> sourceware.org Git - systemtap.git/commitdiff
PR20423: tweak error message generation for case without e->components[]
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 9 Sep 2016 13:43:03 +0000 (09:43 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 9 Sep 2016 13:43:03 +0000 (09:43 -0400)
... e.g. a case where a C function returns a struct, $return would
trigger the "... is being accessed instead of member" message, but the
operative tok* is the e node, not a member of the empty
e->components[].

dwflpp.cxx

index bbeb4a6bfda70aefa35cfa2aa4dc377256c2507d..92535cb2c4fa1e1ecc2dc757f23a1e451a8c9ebb 100644 (file)
@@ -3711,7 +3711,9 @@ dwflpp::translate_final_fetch_or_store (struct obstack *pool,
                                  type_name.c_str(),
                                  decl_source.c_str(),
                                  a_member.c_str()),
-                              e->components[e->components.size()-1].tok);
+                              (e->components.size() > 0 ?
+                               (e->components[e->components.size()-1].tok) :
+                               (e->tok)));
       }
       break;
 
This page took 0.030401 seconds and 5 git commands to generate.