From 59ded443ac132275413b2e6f6e9cb4eb6cba468b Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 11 Jul 2016 21:56:32 +0000 Subject: [cea0344a1] Restore a clearing of the ensemble rewrite in one execution path so attempts to use the data after free are not made. Test namespace-50.9 demonstrates the need for this. --- generic/tclExecute.c | 7 +++++++ tests/namespace.test | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index c0cbd9e..e539161 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2078,6 +2078,13 @@ TclNRExecuteByteCode( #endif /* + * Test namespace-50.9 demonstrates the need for this call. + * Use a --enable-symbols=mem bug to see. + */ + + TclResetRewriteEnsemble(interp, 1); + + /* * Push the callback for bytecode execution */ diff --git a/tests/namespace.test b/tests/namespace.test index 575695f..55505f1 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -2356,6 +2356,13 @@ test namespace-50.8 {[f961d7d1dd]} -setup { rename e {} rename target {} } +test namespace-50.9 {[cea0344a51]} -body { + namespace eval foo { + namespace eval bar { + namespace delete foo + } + } +} -returnCodes error -result {unknown namespace "foo" in namespace delete command} test namespace-51.1 {name resolution path control} -body { namespace eval ::test_ns_1 { -- cgit v0.12