summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-06-04 02:35:18 +0000
committerfche <fche>2005-06-04 02:35:18 +0000
commit8846477c222cdae649b02117cc96999b0be6ad40 (patch)
treef4f046be797d869b6377597c9d941d051fc9a102 /staptree.cxx
parent553d27a587615e4b242a89bf1a7af93b71f050f0 (diff)
downloadsystemtap-steved-8846477c222cdae649b02117cc96999b0be6ad40.tar.gz
systemtap-steved-8846477c222cdae649b02117cc96999b0be6ad40.tar.xz
systemtap-steved-8846477c222cdae649b02117cc96999b0be6ad40.zip
2005-06-03 Frank Ch. Eigler <fche@elastic.org>
* elaborate.cxx (find_*): Remove arity checks from here ... * staptree.cxx (set_arity): Put arity match assertion here. * testsuite/semko/{six,nine}.stp: Confirm logic. * testsuite/transko/one.stp: First translation-time ko test.
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/staptree.cxx b/staptree.cxx
index a8651d1d..756fbc1e 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -96,10 +96,17 @@ void
vardecl::set_arity (int a)
{
assert (a >= 0);
- arity = a;
- index_types.resize (arity);
- for (int i=0; i<arity; i++)
- index_types[i] = pe_unknown;
+
+ if (arity != a && arity >= 0)
+ throw semantic_error ("inconsistent arity", tok);
+
+ if (arity != a)
+ {
+ arity = a;
+ index_types.resize (arity);
+ for (int i=0; i<arity; i++)
+ index_types[i] = pe_unknown;
+ }
}