summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-10-21 13:12:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-10-21 13:12:16 (GMT)
commit1a2743707565baad1836d59d9a6da4a1cdedb488 (patch)
tree0f0ef17613348e2d9b4790012f7d753056f2ade0
parent2f570b44ce96781099a36c1e8a084cb69cb4862f (diff)
parent2ab238514bcdab640de8b1805337200932e2cd79 (diff)
downloadtcl-1a2743707565baad1836d59d9a6da4a1cdedb488.zip
tcl-1a2743707565baad1836d59d9a6da4a1cdedb488.tar.gz
tcl-1a2743707565baad1836d59d9a6da4a1cdedb488.tar.bz2
merge 8.6
-rw-r--r--generic/tclCompCmds.c11
-rw-r--r--generic/tclExecute.c8
-rw-r--r--tests/format.test7
3 files changed, 11 insertions, 15 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index bce17dc..5f4c298 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -3206,17 +3206,6 @@ TclCompileFormatCmd(
*/
TclEmitInstInt1(INST_STR_CONCAT1, i, envPtr);
- } else {
- /*
- * EVIL HACK! Force there to be a string representation in the case
- * where there's just a "%s" in the format; case covered by the test
- * format-20.1 (and it is horrible...)
- */
-
- TclEmitOpcode(INST_DUP, envPtr);
- PushStringLiteral(envPtr, "");
- TclEmitOpcode(INST_STR_EQ, envPtr);
- TclEmitOpcode(INST_POP, envPtr);
}
return TCL_OK;
}
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index aee565c..b19754e 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5784,10 +5784,14 @@ TEBCresume(
/* which has result {} which is same as value3Ptr. */
objResultPtr = value3Ptr;
}
- if (objResultPtr != value3Ptr) {
+ if (objResultPtr == value3Ptr) {
/* See [Bug 82e7f67325] */
- TclDecrRefCount(value3Ptr);
+ TclDecrRefCount(OBJ_AT_TOS);
+ OBJ_AT_TOS = value3Ptr;
+ TRACE_APPEND(("\"%.30s\"\n", O2S(value3Ptr)));
+ NEXT_INST_F(1, 0, 0);
}
+ TclDecrRefCount(value3Ptr);
TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr)));
NEXT_INST_F(1, 1, 1);
diff --git a/tests/format.test b/tests/format.test
index 27eac31..e199398 100644
--- a/tests/format.test
+++ b/tests/format.test
@@ -564,9 +564,12 @@ test format-19.3 {Bug 2830354} {
test format-20.1 {Bug 2932421: plain %s caused intrep change of args} -body {
set x [dict create a b c d]
format %s $x
- # After this, obj in $x should be a dict with a non-NULL bytes field
+ # After this, obj in $x should be a dict
+ # We are testing to make sure it has not been shimmered to a
+ # different intrep when that is not necessary.
+ # Whether or not there is a string rep - we should not care!
tcl::unsupported::representation $x
-} -match glob -result {value is a dict with *, string representation "*"}
+} -match glob -result {value is a dict *}
# cleanup
catch {unset a}