summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2017-02-17 09:20:49 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2017-02-17 09:20:49 (GMT)
commit5772e32729279c7caac6968a62a65e0eb3550eb4 (patch)
tree3c8641d77c107d37898ba2c255c1bc42d88c3ea7 /generic/tclCmdMZ.c
parent3ef7160d4155e52cf26b62290674100b34243e00 (diff)
downloadtcl-5772e32729279c7caac6968a62a65e0eb3550eb4.zip
tcl-5772e32729279c7caac6968a62a65e0eb3550eb4.tar.gz
tcl-5772e32729279c7caac6968a62a65e0eb3550eb4.tar.bz2
Stop problems with representation smashes.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index d6d0152..110de4c 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -811,6 +811,13 @@ Tcl_RegsubObjCmd(
Tcl_AppendObjToObj(resultPtr, Tcl_GetObjResult(interp));
Tcl_ResetResult(interp);
+ /*
+ * Refetch the unicode, in case the representation was smashed by
+ * the user code.
+ */
+
+ wstring = Tcl_GetUnicodeFromObj(objPtr, &wlen);
+
offset += end;
if (end == 0 || start == end) {
/*