From 67146982d334acdb25f43da2a74c02fcabc3c45d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 9 Jun 2009 19:58:15 -0700 Subject: Fix condition propagation across aliases When an instance of an alias has a condition, that condition gets propagated to each of the locations that the alias defines. However, the copy of the location list was not a deep copy, and so all other instances of the alias would also incorrectly receive the condition. This patch makes the location list copy a little deeper, and adds a test case which demonstrates the issue. --- testsuite/systemtap.base/alias-condition.stp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 testsuite/systemtap.base/alias-condition.stp (limited to 'testsuite/systemtap.base/alias-condition.stp') diff --git a/testsuite/systemtap.base/alias-condition.stp b/testsuite/systemtap.base/alias-condition.stp new file mode 100644 index 00000000..89708886 --- /dev/null +++ b/testsuite/systemtap.base/alias-condition.stp @@ -0,0 +1,26 @@ +/* + * alias-condition.stp + * + * Check that conditions are copied correctly across aliases + */ + +/* x should be incremented exactly once */ +global x = 0 +probe foo = begin { } +probe foo if (x < 0), foo { ++x } + +probe begin(1) +{ + println("systemtap starting probe") + exit() +} + +probe end +{ + println("systemtap ending probe") + if ( x != 1 ) { + println("systemtap test failure") + } else { + println("systemtap test success") + } +} -- cgit