summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorgraydon <graydon>2005-08-09 18:17:24 +0000
committergraydon <graydon>2005-08-09 18:17:24 +0000
commitd98d459c440fb476869b34a84bb8a75d28fbb188 (patch)
tree592d6ab998b1bab7c3d67ea23272884f78fc8860 /staptree.cxx
parentdebd8982950caa54b27944775910dd282b82b338 (diff)
downloadsystemtap-steved-d98d459c440fb476869b34a84bb8a75d28fbb188.tar.gz
systemtap-steved-d98d459c440fb476869b34a84bb8a75d28fbb188.tar.xz
systemtap-steved-d98d459c440fb476869b34a84bb8a75d28fbb188.zip
2005-08-09 Graydon Hoare <graydon@redhat.com>
* elaborate.cxx: (delete_statement_symresolution_info): New struct. (symresolution_info::visit_delete_statement): Use it. (delete_statement_typeresolution_info): New struct. (typeresolution_info::visit_delete_statement): Use it. (symresolution_info::find_var): Accept -1 as 'unknown' arity. * elaborate.h: Update to reflect changes in .cxx. * translate.cxx (mapvar::del): New method. (c_unparser::getmap): Check arity >= 1; (delete_statement_operand_visitor): New struct. (c_unparser::visit_delete_statement): Use it. * staptree.cxx (vardecl::set_arity): Accept and ignore -1. (vardecl::compatible_arity): Likewise. * testsuite/buildok/eight.stp: New test for 'delete' operator.
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/staptree.cxx b/staptree.cxx
index b5a7ae49..31330017 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -106,7 +106,8 @@ vardecl::vardecl ():
void
vardecl::set_arity (int a)
{
- assert (a >= 0);
+ if (a < 0)
+ return;
if (arity != a && arity >= 0)
throw semantic_error ("inconsistent arity", tok);
@@ -123,7 +124,7 @@ vardecl::set_arity (int a)
bool
vardecl::compatible_arity (int a)
{
- if (arity == -1)
+ if (arity == -1 || a == -1)
return true;
return arity == a;
}