summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-10-11 13:57:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-10-11 13:57:53 (GMT)
commit918f0fe1aa72e58361aaccf1c8c756a5687bc866 (patch)
treee7cb1aef9d3c96daaa7caf50b06011b2925bdc8e
parent343851002d0cb0f2939aaf96a761357f0b7c972f (diff)
parentf43dd68346925f9c2ab0b55fe60e1cec2526d9dc (diff)
downloadtcl-918f0fe1aa72e58361aaccf1c8c756a5687bc866.zip
tcl-918f0fe1aa72e58361aaccf1c8c756a5687bc866.tar.gz
tcl-918f0fe1aa72e58361aaccf1c8c756a5687bc866.tar.bz2
Merge 8.7
-rw-r--r--generic/tcl.h3
-rw-r--r--generic/tclCompile.c4
-rw-r--r--generic/tclDecls.h15
-rw-r--r--generic/tclProc.c2
-rw-r--r--tests/proc.test9
5 files changed, 29 insertions, 4 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index fa61efc..86bd693 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -1353,6 +1353,9 @@ typedef enum {
typedef struct Tcl_Time {
long sec; /* Seconds. */
long usec; /* Microseconds. */
+#if defined(_WIN32) && defined(_WIN64)
+ long long reserved; /* Not used, except for win64 <-> Cygwin64 interoperability. */
+#endif
} Tcl_Time;
typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 5b047b3..c89fedb 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -731,7 +731,7 @@ const Tcl_ObjType tclByteCodeType = {
/*
* subtCodeType provides the standard type managemnt procedures for the
- * substcode type, which represents substiution within a Tcl value.
+ * substcode type, which represents substiution within a Tcl value.
*/
static const Tcl_ObjType substCodeType = {
@@ -1959,7 +1959,7 @@ CompileCmdCompileProc(
*
* atCmdStart == 2 : Don't use the INST_START_CMD instruction.
* atCmdStart == 1 : INST_START_CMD was the last instruction emitted,
- * : so no need to emit another. Instead
+ * : so no need to emit another. Instead
* : increment the number of cmds started at it, except
* : for the special case at the start of a script.
* atCmdStart == 0 : The last instruction was something else.
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index f833206..71c5e47 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4129,7 +4129,20 @@ extern const TclStubs *tclStubsPtr;
} while(0)
#endif /* TCL_NO_DEPRECATED */
-#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
+#if defined(USE_TCL_STUBS)
+# if defined(_WIN32) && defined(_WIN64)
+# undef Tcl_GetTime
+/* Handle Win64 tk.dll being loaded in Cygwin64. */
+# define Tcl_GetTime(t) \
+ do { \
+ Tcl_Time *_timePtr = (t); \
+ _timePtr->reserved = -1; \
+ tclStubsPtr->tcl_GetTime((_timePtr)); \
+ if (_timePtr->reserved != -1) { \
+ _timePtr->usec = _timePtr->reserved; \
+ } \
+ } while (0)
+# endif
# if defined(__CYGWIN__) && defined(TCL_WIDE_INT_IS_LONG)
/* On Cygwin64, long is 64-bit while on Win64 long is 32-bit. Therefore
* we have to make sure that all stub entries on Cygwin64 follow the
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 402b752..306f04c 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -529,7 +529,7 @@ TclCreateProc(
"FORMALARGUMENTFORMAT", NULL);
goto procError;
}
- if ((fieldCount == 0) || (fieldValues[0]->length == 0)) {
+ if ((fieldCount == 0) || (Tcl_GetCharLength(fieldValues[0]) == 0)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"argument with no name", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
diff --git a/tests/proc.test b/tests/proc.test
index ab32567..b87af57 100644
--- a/tests/proc.test
+++ b/tests/proc.test
@@ -325,6 +325,15 @@ test proc-4.8 {TclCreateProc, procbody obj, no leak on multiple iterations} -set
test proc-4.9 {[39fed4dae5] Valid Tcl_PkgPresent return} tcl::test {
tcl::procbodytest::check
} 1
+test proc-4.10 {
+ TclCreateProc, issue a8579d906a28, argument with no name
+} -body {
+ catch {
+ proc p1 [list [list [expr {1 + 2}] default]] {}
+ }
+} -cleanup {
+ catch {rename p1 {}}
+} -result 0
test proc-5.1 {Bytecompiling noop; test for correct argument substitution} -body {
proc p args {} ; # this will be bytecompiled into t