summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-05-24 20:29:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-05-24 20:29:35 (GMT)
commit55a0957a84fa30d7881c6ed4ca5d10d9760aa6c1 (patch)
treec898d491bd47677de6caa7f90d8908614c027467
parent6f3bd38c61b5deddb1bcd376c798ca8aa12351a7 (diff)
parent0a2318649c91cff9d31bef133fb6a96ad9786bed (diff)
downloadtcl-55a0957a84fa30d7881c6ed4ca5d10d9760aa6c1.zip
tcl-55a0957a84fa30d7881c6ed4ca5d10d9760aa6c1.tar.gz
tcl-55a0957a84fa30d7881c6ed4ca5d10d9760aa6c1.tar.bz2
Merge the bug fix and test case.
-rw-r--r--generic/tclEnsemble.c3
-rw-r--r--tests/namespace.test16
2 files changed, 18 insertions, 1 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index f108030..e37ad1a 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -1901,7 +1901,8 @@ NsEnsembleImplementationCmdNR(
if (ni > 0) {
//fprintf(stdout, "COVER\n"); fflush(stdout);
iPtr->ensembleRewrite.numRemovedObjs += ni;
- iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-1;
+ iPtr->ensembleRewrite.numInsertedObjs
+ = prefixObjc + ensemblePtr->numParameters;
} else {
iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-2;
}
diff --git a/tests/namespace.test b/tests/namespace.test
index cb9bc8c..2ba695a 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -2928,6 +2928,22 @@ test namespace-53.10 {ensembles: nested rewrite} -setup {
0 {1 v}\
1 {wrong # args: should be "ns v x z2 a2"}\
0 {2 v v2}}
+test namespace-53.11 {ensembles: nested rewrite} -setup {
+ namespace eval ns {
+ namespace export x
+ namespace eval x {
+ proc z2 {a1 a2} {list 2 $a1 $a2}
+ namespace export z*
+ namespace ensemble create -parameter p
+ }
+ namespace ensemble create
+ }
+} -body {
+ list [catch {ns x 1 z2} msg] $msg
+} -cleanup {
+ namespace delete ns
+ unset -nocomplain msg
+} -result {1 {wrong # args: should be "ns x 1 z2 a2"}}
test namespace-54.1 {leak on namespace deletion} -constraints {memory} \
-setup {