summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorgraydon <graydon>2005-12-09 02:20:41 +0000
committergraydon <graydon>2005-12-09 02:20:41 +0000
commit460b2038d243704fa1678e94d4b7098eb6f3d8f8 (patch)
tree785433614274b0d01495101ed4b6e9d9cdcb8172 /translate.cxx
parent0c6296b282d40c4e39f0af6ddde0d6f74e477147 (diff)
downloadsystemtap-steved-460b2038d243704fa1678e94d4b7098eb6f3d8f8.tar.gz
systemtap-steved-460b2038d243704fa1678e94d4b7098eb6f3d8f8.tar.xz
systemtap-steved-460b2038d243704fa1678e94d4b7098eb6f3d8f8.zip
2005-12-08 Graydon Hoare <graydon@redhat.com>
* translate.cxx (delete_statement_operand_visitor::visit_arrayindex): Prohibit deleting histogram buckets. (c_tmpcounter::visit_array_in): Direct to visit_arrayindex. (c_unparser::visit_array_in): Likewise. * testsuite/buildok/histogram_operator_in.stp: New test.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/translate.cxx b/translate.cxx
index a4ca176d..f2a848f3 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -2082,8 +2082,7 @@ delete_statement_operand_visitor::visit_arrayindex (arrayindex* e)
}
else
{
- // FIXME: fill in some logic here!
- assert(false);
+ throw semantic_error("cannot delete histogram bucket entries\n", e->tok);
}
}
@@ -2282,8 +2281,14 @@ c_tmpcounter::visit_array_in (array_in* e)
}
else
{
- // FIXME: fill in some logic here!
- assert(false);
+ // By definition:
+ //
+ // 'foo in @hist_op(...)' is true iff
+ // '@hist_op(...)[foo]' is nonzero
+ //
+ // so we just delegate to the latter call, since int64_t is also
+ // our boolean type.
+ e->operand->visit(this);
}
}
@@ -2315,8 +2320,14 @@ c_unparser::visit_array_in (array_in* e)
}
else
{
- // FIXME: fill in some logic here!
- assert(false);
+ // By definition:
+ //
+ // 'foo in @hist_op(...)' is true iff
+ // '@hist_op(...)[foo]' is nonzero
+ //
+ // so we just delegate to the latter call, since int64_t is also
+ // our boolean type.
+ e->operand->visit(this);
}
}