summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 51e2917f..daf6cb2b 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -48,7 +48,6 @@ extern "C" {
#include <stdio.h>
#include <sys/types.h>
-#include "loc2c.h"
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
}
@@ -2335,6 +2334,9 @@ dwarf_var_expanding_visitor::visit_target_symbol (target_symbol *e)
if (dwarf_getscopes_die (scope_die, &scopes) == 0)
return;
+ if (e->addressof)
+ throw semantic_error("cannot take address of context variable", e->tok);
+
target_symbol *tsym = new target_symbol;
print_format* pf = new print_format;
@@ -3365,6 +3367,9 @@ sdt_var_expanding_visitor::visit_target_symbol (target_symbol *e)
{
if (e->base_name == "$$name")
{
+ if (e->addressof)
+ throw semantic_error("cannot take address of sdt variable", e->tok);
+
literal_string *myname = new literal_string (probe_name);
myname->tok = e->tok;
provide(myname);
@@ -3418,6 +3423,9 @@ sdt_var_expanding_visitor::visit_target_symbol (target_symbol *e)
if (e->components.empty())
{
+ if (e->addressof)
+ throw semantic_error("cannot take address of sdt variable", e->tok);
+
provide(fc);
return;
}
@@ -5050,6 +5058,9 @@ tracepoint_var_expanding_visitor::visit_target_symbol_arg (target_symbol* e)
if (e->components.empty())
{
+ if (e->addressof)
+ throw semantic_error("cannot take address of tracepoint variable", e->tok);
+
// Just grab the value from the probe locals
e->probe_context_var = "__tracepoint_arg_" + arg->name;
e->type = pe_long;
@@ -5149,6 +5160,9 @@ tracepoint_var_expanding_visitor::visit_target_symbol_arg (target_symbol* e)
void
tracepoint_var_expanding_visitor::visit_target_symbol_context (target_symbol* e)
{
+ if (e->addressof)
+ throw semantic_error("cannot take address of context variable", e->tok);
+
if (is_active_lvalue (e))
throw semantic_error("write to tracepoint '" + e->base_name + "' not permitted", e->tok);