From 775b09cb001aae11f753654ae22365f295f56fe8 Mon Sep 17 00:00:00 2001 From: oehhar Date: Wed, 21 Oct 2015 20:30:49 +0000 Subject: Change "clock format -format %x -locale current" output on msgcat locale change [4a0c163d24] --- library/clock.tcl | 36 ++++++++++++++++++++++++++++++++++++ tests/clock.test | 13 +++++++++++++ 2 files changed, 49 insertions(+) diff --git a/library/clock.tcl b/library/clock.tcl index bfdf832..8e4b657 100755 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -111,6 +111,7 @@ proc ::tcl::clock::Initialize {} { mcpackagelocale set {} ::msgcat::mcpackageconfig set mcfolder [file join $LibDir msgs] ::msgcat::mcpackageconfig set unknowncmd "" + ::msgcat::mcpackageconfig set changecmd ChangeCurrentLocale # Define the message catalog for the root locale. @@ -4475,6 +4476,41 @@ proc ::tcl::clock::AddDays { days clockval timezone changeover } { #---------------------------------------------------------------------- # +# ChangeCurrentLocale -- +# +# The global locale was changed within msgcat. +# Clears the buffered parse functions of the current locale. +# +# Parameters: +# loclist (ignored) +# +# Results: +# None. +# +# Side effects: +# Buffered parse functions are cleared. +# +#---------------------------------------------------------------------- + +proc ::tcl::clock::ChangeCurrentLocale {args} { + variable FormatProc + variable LocaleNumeralCache + variable CachedSystemTimeZone + variable TimeZoneBad + + foreach p [info procs [namespace current]::scanproc'*'current] { + rename $p {} + } + foreach p [info procs [namespace current]::formatproc'*'current] { + rename $p {} + } + + catch {array unset FormatProc *'current} + set LocaleNumeralCache {} +} + +#---------------------------------------------------------------------- +# # ClearCaches -- # # Clears all caches to reclaim the memory used in [clock] diff --git a/tests/clock.test b/tests/clock.test index 2abeab9..4f69ed3 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -36931,6 +36931,19 @@ test clock-67.2 {Bug d19a30db57} -body { # error, not segfault tcl::clock::GetJulianDayFromEraYearMonthDay {} 2361222 } -returnCodes error -match glob -result * + +test clock-67.3 {Change %x output on global locale change [Bug 4a0c163d24]} -setup { + package require msgcat + set current [msgcat::mclocale] +} -body { + msgcat::mclocale de_de + set res [clock format 1 -locale current -format %x] + msgcat::mclocale en_uk + lappend res [clock format 1 -locale current -format %x] +} -cleanup { + msgcat::mclocale $current +} -result {01.01.1970 01/01/1970} + test clock-67.3 {Bug d19a30db57} -body { # error, not segfault tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 -- cgit v0.12 From 4479e16df25d9fad8636372be8e5010eb70df2c9 Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 23 Oct 2015 08:08:09 +0000 Subject: New test for clock scan, test numbering corrected --- tests/clock.test | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) mode change 100644 => 100755 tests/clock.test diff --git a/tests/clock.test b/tests/clock.test old mode 100644 new mode 100755 index 4f69ed3..d4f0bc9 --- a/tests/clock.test +++ b/tests/clock.test @@ -36932,22 +36932,35 @@ test clock-67.2 {Bug d19a30db57} -body { tcl::clock::GetJulianDayFromEraYearMonthDay {} 2361222 } -returnCodes error -match glob -result * -test clock-67.3 {Change %x output on global locale change [Bug 4a0c163d24]} -setup { +test clock-67.3 {Bug d19a30db57} -body { + # error, not segfault + tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 +} -returnCodes error -match glob -result * + +test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24]} -setup { package require msgcat set current [msgcat::mclocale] } -body { msgcat::mclocale de_de - set res [clock format 1 -locale current -format %x] + set res [list [clock format 1 -locale current -format %x]] msgcat::mclocale en_uk lappend res [clock format 1 -locale current -format %x] } -cleanup { msgcat::mclocale $current } -result {01.01.1970 01/01/1970} -test clock-67.3 {Bug d19a30db57} -body { - # error, not segfault - tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 -} -returnCodes error -match glob -result * +test clock-67.5 {Change scan %x output on global locale change [Bug 4a0c163d24]} -setup { + package require msgcat + set current [msgcat::mclocale] +} -body { + msgcat::mclocale de_de + set res [clock scan "01.01.1970" -locale current -format %x] + msgcat::mclocale en_uk + # This will fail without the bug fix, as still de_de is active + expr {$res == [clock scan "01/01/1970" -locale current -format %x]} +} -cleanup { + msgcat::mclocale $current +} -result {1} # cleanup -- cgit v0.12 From f99f9dafa7b110163fe611aa0b1662d1487a61dc Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 23 Oct 2015 12:52:19 +0000 Subject: Make test clock-67.4 time zone independent. Bug [4a0c163d24] --- tests/clock.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/clock.test b/tests/clock.test index d4f0bc9..615f3a8 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -36942,12 +36942,12 @@ test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24 set current [msgcat::mclocale] } -body { msgcat::mclocale de_de - set res [list [clock format 1 -locale current -format %x]] + set res [regexp {^\d{2}\.\d{2}\.\d{4}$} [clock format 1 -locale current -format %x]] msgcat::mclocale en_uk - lappend res [clock format 1 -locale current -format %x] + lappend res [regexp {^\d{2}/\d{2}/\d{4}$} [clock format 1 -locale current -format %x]] } -cleanup { msgcat::mclocale $current -} -result {01.01.1970 01/01/1970} +} -result {1 1} test clock-67.5 {Change scan %x output on global locale change [Bug 4a0c163d24]} -setup { package require msgcat -- cgit v0.12 From 2117a3bcf0ee00ee1c7036744732be970cfd6181 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 23 Oct 2015 14:57:56 +0000 Subject: Backout of failed attempt to fix [32ae34e63a] got checked into wrong branch. --- generic/tclIO.c | 47 ++----------- generic/tclIORChan.c | 8 +++ tests/io.test | 186 --------------------------------------------------- tests/ioCmd.test | 26 +++---- 4 files changed, 25 insertions(+), 242 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 0910cc5..9a4735f 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -113,30 +113,11 @@ typedef struct CopyState { Tcl_WideInt total; /* Total bytes transferred (written). */ Tcl_Interp *interp; /* Interp that started the copy. */ Tcl_Obj *cmdPtr; /* Command to be invoked at completion. */ - int refCount; /* Claim count on the struct */ - int bufInUse; /* Flag to govern access to buffer */ int bufSize; /* Size of appended buffer. */ char buffer[1]; /* Copy buffer, this must be the last * field. */ } CopyState; -static void -PreserveCopyState( - CopyState *csPtr) -{ - csPtr->refCount++; -} - -static void -ReleaseCopyState( - CopyState *csPtr) -{ - if (--csPtr->refCount) { - return; - } - ckfree((char *) csPtr); -} - /* * All static variables used in this file are collected into a single instance * of the following structure. For multi-threaded implementations, there is @@ -8668,13 +8649,9 @@ TclCopyChannel( Tcl_IncrRefCount(cmdPtr); } csPtr->cmdPtr = cmdPtr; - csPtr->refCount = 1; - csPtr->bufInUse = 0; inStatePtr->csPtrR = csPtr; - PreserveCopyState(csPtr); outStatePtr->csPtrW = csPtr; - PreserveCopyState(csPtr); /* * Special handling of -size 0 async transfers, so that the -command is @@ -8726,11 +8703,6 @@ CopyData( /* Encoding control */ int underflow; /* Input underflow */ - if (csPtr->bufInUse) { - return TCL_OK; - } - PreserveCopyState(csPtr); - inChan = (Tcl_Channel) csPtr->readPtr; outChan = (Tcl_Channel) csPtr->writePtr; inStatePtr = csPtr->readPtr->state; @@ -8792,7 +8764,6 @@ CopyData( sizeb = csPtr->toRead; } - csPtr->bufInUse = 1; if (inBinary || sameEncoding) { size = DoRead(inStatePtr->topChanPtr, csPtr->buffer, sizeb); } else { @@ -8843,7 +8814,6 @@ CopyData( TclDecrRefCount(bufObj); bufObj = NULL; } - ReleaseCopyState(csPtr); return TCL_OK; } } @@ -8864,7 +8834,6 @@ CopyData( } else { sizeb = WriteChars(outStatePtr->topChanPtr, buffer, sizeb); } - csPtr->bufInUse = 0; /* * [Bug 2895565]. At this point 'size' still contains the number of @@ -8936,7 +8905,6 @@ CopyData( TclDecrRefCount(bufObj); bufObj = NULL; } - ReleaseCopyState(csPtr); return TCL_OK; } @@ -8959,7 +8927,6 @@ CopyData( TclDecrRefCount(bufObj); bufObj = NULL; } - ReleaseCopyState(csPtr); return TCL_OK; } } /* while */ @@ -8975,14 +8942,15 @@ CopyData( */ total = csPtr->total; - if (cmdPtr && interp && csPtr->cmdPtr) { + if (cmdPtr && interp) { int code; /* * Get a private copy of the command so we can mutate it by adding * arguments. Note that StopCopy frees our saved reference to the * original command obj. */ - cmdPtr = Tcl_DuplicateObj(csPtr->cmdPtr); + + cmdPtr = Tcl_DuplicateObj(cmdPtr); Tcl_IncrRefCount(cmdPtr); StopCopy(csPtr); Tcl_Preserve(interp); @@ -9010,7 +8978,6 @@ CopyData( } } } - ReleaseCopyState(csPtr); return result; } @@ -9324,16 +9291,10 @@ StopCopy( CopyEventProc, csPtr); } TclDecrRefCount(csPtr->cmdPtr); - csPtr->cmdPtr = NULL; - } - if (inStatePtr->csPtrR == NULL) { - return; } - ReleaseCopyState(inStatePtr->csPtrR); inStatePtr->csPtrR = NULL; - ReleaseCopyState(outStatePtr->csPtrW); outStatePtr->csPtrW = NULL; - ReleaseCopyState(csPtr); + ckfree((char *) csPtr); } /* diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 2e5fa45..bbb5b88 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -1508,6 +1508,14 @@ ReflectWatch( mask &= rcPtr->mode; + if (mask == rcPtr->interest) { + /* + * Same old, same old, why should we do something? + */ + + return; + } + rcPtr->interest = mask; /* diff --git a/tests/io.test b/tests/io.test index 914cbca..50c5808 100644 --- a/tests/io.test +++ b/tests/io.test @@ -7886,192 +7886,6 @@ test io-53.15 {[ed29c4da21] DoRead: fblocked seen as error} -setup { removeFile out } -result 100 -test io-53.18 {[32ae34e63a] recursive CopyData} -setup { - proc driver {cmd args} { - variable buffer - variable index - set chan [lindex $args 0] - switch -- $cmd { - initialize { - set index($chan) 0 - set buffer($chan) [encoding convertto utf-8 \ - [string repeat a 100]] - return {initialize finalize watch read} - } - finalize { - unset index($chan) buffer($chan) - return - } - watch { - if {"read" in [lindex $args 1]} { - chan postevent $chan read - } - return - } - read { - set n [lindex $args 1] - set new [expr {$index($chan) + $n}] - set result [string range $buffer($chan) $index($chan) $new-1] - set index($chan) $new - return $result - } - } - } - proc more {c outChan bytes args} { - if {[eof $c]} { - set ::done eof - catch {close $c} - return - } - if {[llength $args]} { - set ::done error - } else { - chan copy $c $outChan -command [list [namespace which more] $c $outChan] - } - } - set c [chan create read [namespace which driver]] - chan configure $c -encoding utf-8 - set out [makeFile {} out] - set outChan [open $out w] - # Different encoding to force use of DoReadChars() - chan configure $outChan -encoding iso8859-1 -} -body { - after 100 {set ::done timeout} - chan copy $c $outChan -size 99 -command [list [namespace which more] $c $outChan] - vwait ::done - set ::done -} -cleanup { - close $outChan - removeFile out - rename driver {} - rename more {} - unset ::done -} -result eof - -test io-53.19 {[32ae34e63a] stop ReflectWatch filtering} -setup { - proc driver {cmd args} { - variable buffer - variable index - set chan [lindex $args 0] - switch -- $cmd { - initialize { - set index($chan) 0 - set buffer($chan) [encoding convertto utf-8 \ - [string repeat a 100]] - return {initialize finalize watch read} - } - finalize { - unset index($chan) buffer($chan) - return - } - watch { - if {"read" in [lindex $args 1]} { - chan postevent $chan read - } - return - } - read { - set n [lindex $args 1] - set new [expr {$index($chan) + $n}] - set result [string range $buffer($chan) $index($chan) $new-1] - set index($chan) $new - return $result - } - } - } - proc more {c outChan bytes args} { - if {[eof $c]} { - set ::done eof - catch {close $c} - return - } - if {[llength $args]} { - set ::done error - } else { - chan copy $c $outChan -size 30 -command [list [namespace which more] $c $outChan] - } - } - set c [chan create read [namespace which driver]] - chan configure $c -encoding utf-8 -buffersize 20 - set out [makeFile {} out] - set outChan [open $out w] - # Different encoding to force use of DoReadChars() - chan configure $outChan -encoding iso8859-1 -} -body { - after 100 {set ::done timeout} - chan copy $c $outChan -size 30 -command [list [namespace which more] $c $outChan] - vwait ::done - set ::done -} -cleanup { - catch {close $outChan} - removeFile out - rename driver {} - rename more {} - unset ::done -} -result eof - -test io-53.20 {[e0a7b3e5f8] DoRead calls to UpdateInterest} -setup { - proc driver {cmd args} { - variable buffer - variable index - set chan [lindex $args 0] - switch -- $cmd { - initialize { - set index($chan) 0 - set buffer($chan) [encoding convertto utf-8 \ - [string repeat a 100]] - return {initialize finalize watch read} - } - finalize { - unset index($chan) buffer($chan) - return - } - watch { - if {"read" in [lindex $args 1]} { - chan postevent $chan read - } - return - } - read { - set n [lindex $args 1] - set new [expr {$index($chan) + $n}] - set result [string range $buffer($chan) $index($chan) $new-1] - set index($chan) $new - return $result - } - } - } - proc more {c outChan bytes args} { - if {[eof $c]} { - set ::done eof - catch {close $c} - return - } - if {[llength $args]} { - set ::done error - } else { - chan copy $c $outChan -size 10 -command [list [namespace which more] $c $outChan] - } - } - set c [chan create read [namespace which driver]] - chan configure $c -encoding utf-8 -buffersize 20 - set out [makeFile {} out] - set outChan [open $out w] - # Same encoding to force use of DoRead() - chan configure $outChan -encoding utf-8 -} -body { - after 100 {set ::done timeout} - chan copy $c $outChan -size 10 -command [list [namespace which more] $c $outChan] - vwait ::done - set ::done -} -cleanup { - catch {close $outChan} - removeFile out - rename driver {} - rename more {} - unset ::done -} -result eof - test io-54.1 {Recursive channel events} {socket fileevent} { # This test checks to see if file events are delivered during recursive # event loops when there is buffered data on the channel. diff --git a/tests/ioCmd.test b/tests/ioCmd.test index e2a6d84..5a76d48 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -981,7 +981,7 @@ test iocmd-23.1 {chan read, regular data return} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {read rc* 4096} {watch rc* {}} snarfsnarf} +} -result {{read rc* 4096} {read rc* 4096} snarfsnarf} test iocmd-23.2 {chan read, bad data return, to much} -match glob -body { set res {} proc foo {args} { @@ -993,7 +993,7 @@ test iocmd-23.2 {chan read, bad data return, to much} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 {read delivered more than requested}} +} -result {{read rc* 4096} 1 {read delivered more than requested}} test iocmd-23.3 {chan read, for non-readable channel} -match glob -body { set res {} proc foo {args} { @@ -1016,7 +1016,7 @@ test iocmd-23.4 {chan read, error return} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 BOOM!} +} -result {{read rc* 4096} 1 BOOM!} test iocmd-23.5 {chan read, break return is error} -match glob -body { set res {} proc foo {args} { @@ -1028,7 +1028,7 @@ test iocmd-23.5 {chan read, break return is error} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code*} +} -result {{read rc* 4096} 1 *bad code*} test iocmd-23.6 {chan read, continue return is error} -match glob -body { set res {} proc foo {args} { @@ -1040,7 +1040,7 @@ test iocmd-23.6 {chan read, continue return is error} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code*} +} -result {{read rc* 4096} 1 *bad code*} test iocmd-23.7 {chan read, custom return is error} -match glob -body { set res {} proc foo {args} { @@ -1052,7 +1052,7 @@ test iocmd-23.7 {chan read, custom return is error} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code*} +} -result {{read rc* 4096} 1 *bad code*} test iocmd-23.8 {chan read, level is squashed} -match glob -body { set res {} proc foo {args} { @@ -1064,7 +1064,7 @@ test iocmd-23.8 {chan read, level is squashed} -match glob -body { close $c rename foo {} set res -} -result {{read rc* 4096} {watch rc* {}} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} +} -result {{read rc* 4096} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} test iocmd-23.9 {chan read, no data means eof} -match glob -setup { set res {} proc foo {args} { @@ -1080,7 +1080,7 @@ test iocmd-23.9 {chan read, no data means eof} -match glob -setup { close $c rename foo {} unset res -} -result {{read rc* 4096} {watch rc* {}} {} 1} +} -result {{read rc* 4096} {} 1} test iocmd-23.10 {chan read, EAGAIN means no data, yet no eof either} -match glob -setup { set res {} proc foo {args} { @@ -1096,7 +1096,7 @@ test iocmd-23.10 {chan read, EAGAIN means no data, yet no eof either} -match glo close $c rename foo {} unset res -} -result {{read rc* 4096} {watch rc* {}} {} 0} +} -result {{read rc* 4096} {} 0} test iocmd-23.11 {chan read, close pulls the rug out} -match glob -body { set res {} proc foo {args} { @@ -1410,14 +1410,14 @@ test iocmd-25.10 {chan configure, cgetall, level is ignored} -match glob -body { test iocmd-26.1 {chan configure, set standard option} -match glob -body { set res {} proc foo {args} { - oninit configure; onfinal; track; return + oninit configure; onfinal; track; note MUST_NOT_HAPPEN; return } set c [chan create {r w} foo] note [fconfigure $c -translation lf] close $c rename foo {} set res -} -result {{watch rc* {}} {}} +} -result {{}} test iocmd-26.2 {chan configure, set option, error return} -match glob -body { set res {} proc foo {args} { @@ -1955,7 +1955,7 @@ test iocmd-31.6 {chan postevent, posted events do happen} -match glob -body { close $c rename foo {} set res -} -result {{watch rc* read} {} TOCK {watch rc* read} {} {watch rc* {}}} +} -result {{watch rc* read} {} TOCK {} {watch rc* {}}} test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} @@ -1968,7 +1968,7 @@ test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { close $c rename foo {} set res -} -result {{watch rc* write} {} TOCK {watch rc* write} {} {watch rc* {}}} +} -result {{watch rc* write} {} TOCK {} {watch rc* {}}} test iocmd-31.8 {chan postevent after close throws error} -match glob -setup { proc foo {args} {oninit; onfinal; track; return} proc dummy args { return } -- cgit v0.12 From b40c3af17683766d1e1359c9ceb4dd7178f6afc5 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Fri, 23 Oct 2015 22:29:23 +0000 Subject: Correct bad regexp in platform::identify that causes it to return incorrect results everywhere. --- library/platform/platform.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index c596e60..0160184 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -165,7 +165,7 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)-([^-]+)$} $id -> plat ver wow cpu + regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu switch -- $plat { solaris { -- cgit v0.12 From 24c49324b4488e47b21eaa259a0950464f9b930c Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 23 Oct 2015 22:30:57 +0000 Subject: Ensure that at lease the format of the output of the platform package's commands is consistently parsable. --- tests/platform.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/platform.test b/tests/platform.test index ab82d07..b5ddc48 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -1,4 +1,4 @@ -# The file tests the tcl_platform variable +# The file tests the tcl_platform variable and platform package. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and @@ -54,6 +54,17 @@ test platform-3.1 {CPU ID on Windows/UNIX} \ -match regexp \ -result {^(?:AuthenticAMD|CentaurHauls|CyrixInstead|GenuineIntel)$} +# The platform package makes very few promises, but does promise that the +# format of string it produces consists of two non-empty words separated by a +# hyphen. +package require platform +test platform-4.1 {format of platform::identify result} -match regexp -body { + platform::identify +} -result {^[^-]+-[^-]+$} +test platform-4.2 {format of platform::generic result} -match regexp -body { + platform::generic +} -result {^[^-]+-[^-]+$} + # cleanup cleanupTests -- cgit v0.12 From d0c545cc65b329440189d7ebfec034137b26e0e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 24 Oct 2015 07:40:30 +0000 Subject: Bring back regexp to wat it was in latest release. This is the correct fix for kbk's attempt. --- library/platform/platform.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 0160184..35a22a3 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -165,7 +165,7 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu + regexp {^([^-]+)-([^-]+)$} $id -> plat cpu switch -- $plat { solaris { -- cgit v0.12 From 042f85a7d6565407ef15942699cb0e1d2f28330e Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 24 Oct 2015 16:01:56 +0000 Subject: A more lenient test; different platforms are more diverse in their correct output. --- tests/platform.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/platform.test b/tests/platform.test index b5ddc48..51b9067 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -60,10 +60,10 @@ test platform-3.1 {CPU ID on Windows/UNIX} \ package require platform test platform-4.1 {format of platform::identify result} -match regexp -body { platform::identify -} -result {^[^-]+-[^-]+$} +} -result {^([^-]+-)+[^-]+$} test platform-4.2 {format of platform::generic result} -match regexp -body { platform::generic -} -result {^[^-]+-[^-]+$} +} -result {^([^-]+-)+[^-]+$} # cleanup cleanupTests -- cgit v0.12 From e36e1a062d95b44a81c16c2435d235196ca8aa4c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 19:39:38 +0000 Subject: Remove use of HAVE_USLEEP. It isn't use anywhere any more. --- unix/configure.in | 6 ------ unix/tcl.m4 | 42 ------------------------------------------ 2 files changed, 48 deletions(-) diff --git a/unix/configure.in b/unix/configure.in index 9c93024..6c7cc09 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -479,12 +479,6 @@ if test $tcl_cv_putenv_copy = yes; then fi #-------------------------------------------------------------------- -# Check for support of usleep function -#-------------------------------------------------------------------- - -SC_ENABLE_USLEEP - -#-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d7d6a7b..7a0b677 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -808,48 +808,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ ]) #------------------------------------------------------------------------ -# SC_ENABLE_USLEEP -- -# -# Allows use of usleep function. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-usleep=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_USLEEP Triggers use of usleep if defined. -#------------------------------------------------------------------------ - -AC_DEFUN([SC_ENABLE_USLEEP], [ - AC_ARG_ENABLE(usleep, - AC_HELP_STRING([--enable-usleep], - [use usleep if possible to sleep, otherwise use Tcl_Sleep (default: on)]), - [usleep_ok=$enableval], [usleep_ok=yes]) - - HAVE_USLEEP=0 - if test "$usleep_ok" = "yes"; then - AC_CHECK_HEADER(unistd.h,[usleep_ok=yes],[usleep_ok=no]) - fi - AC_MSG_CHECKING([whether to use usleep]) - if test "$usleep_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_usleep_h, [ - AC_TRY_COMPILE([#include ], [usleep(0);], - [tcl_cv_usleep_h=yes],[tcl_cv_usleep_h=no])]) - AC_MSG_RESULT([$tcl_cv_usleep_h]) - if test $tcl_cv_usleep_h = yes; then - AC_DEFINE(HAVE_USLEEP, 1, [Do we have usleep()?]) - fi - else - AC_MSG_RESULT([$usleep_ok]) - fi -]) - -#------------------------------------------------------------------------ # SC_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. -- cgit v0.12 From bbe3301cc5fb0ed82fefb30d8f810ea5492fd58d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 22:45:39 +0000 Subject: re-generate "configure", both for unix and win --- unix/configure | 231 --------------------------------------------------------- win/configure | 8 +- 2 files changed, 4 insertions(+), 235 deletions(-) diff --git a/unix/configure b/unix/configure index bbac11d..692b801 100755 --- a/unix/configure +++ b/unix/configure @@ -857,8 +857,6 @@ Optional Features: --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) - --enable-usleep use usleep if possible to sleep, otherwise use - Tcl_Sleep (default: on) --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on) --enable-dll-unloading enable the 'unload' command (default: on) @@ -16434,235 +16432,6 @@ _ACEOF fi #-------------------------------------------------------------------- -# Check for support of usleep function -#-------------------------------------------------------------------- - - - # Check whether --enable-usleep or --disable-usleep was given. -if test "${enable_usleep+set}" = set; then - enableval="$enable_usleep" - usleep_ok=$enableval -else - usleep_ok=yes -fi; - - HAVE_USLEEP=0 - if test "$usleep_ok" = "yes"; then - if test "${ac_cv_header_unistd_h+set}" = set; then - echo "$as_me:$LINENO: checking for unistd.h" >&5 -echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6 -if test "${ac_cv_header_unistd_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5 -echo "${ECHO_T}$ac_cv_header_unistd_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking unistd.h usability" >&5 -echo $ECHO_N "checking unistd.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking unistd.h presence" >&5 -echo $ECHO_N "checking unistd.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: unistd.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: unistd.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: unistd.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: unistd.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: unistd.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: unistd.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: unistd.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: unistd.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: unistd.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------ ## -## Report this to the tcl lists. ## -## ------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for unistd.h" >&5 -echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6 -if test "${ac_cv_header_unistd_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_unistd_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5 -echo "${ECHO_T}$ac_cv_header_unistd_h" >&6 - -fi -if test $ac_cv_header_unistd_h = yes; then - usleep_ok=yes -else - usleep_ok=no -fi - - - fi - echo "$as_me:$LINENO: checking whether to use usleep" >&5 -echo $ECHO_N "checking whether to use usleep... $ECHO_C" >&6 - if test "$usleep_ok" = "yes"; then - if test "${tcl_cv_usleep_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -usleep(0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_usleep_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_usleep_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - echo "$as_me:$LINENO: result: $tcl_cv_usleep_h" >&5 -echo "${ECHO_T}$tcl_cv_usleep_h" >&6 - if test $tcl_cv_usleep_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_USLEEP 1 -_ACEOF - - fi - else - echo "$as_me:$LINENO: result: $usleep_ok" >&5 -echo "${ECHO_T}$usleep_ok" >&6 - fi - - -#-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- diff --git a/win/configure b/win/configure index dc03e62..63d6765 100755 --- a/win/configure +++ b/win/configure @@ -4775,21 +4775,21 @@ TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" -eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\"" +eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\"" +eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\"" +eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" -eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\"" +eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" # Install time header dir can be set via --includedir -- cgit v0.12 From 18425b42d186aee1a919721890d7ffeb875137c3 Mon Sep 17 00:00:00 2001 From: venkat Date: Tue, 27 Oct 2015 23:16:06 +0000 Subject: Update to tzdata2015g from ietf --- library/tzdata/America/Fort_Nelson | 151 +++++++++++++++++++++++++++++++++++++ library/tzdata/Europe/Istanbul | 3 +- library/tzdata/Pacific/Fiji | 72 +++++++++--------- library/tzdata/Pacific/Norfolk | 3 + 4 files changed, 192 insertions(+), 37 deletions(-) create mode 100644 library/tzdata/America/Fort_Nelson diff --git a/library/tzdata/America/Fort_Nelson b/library/tzdata/America/Fort_Nelson new file mode 100644 index 0000000..d819368 --- /dev/null +++ b/library/tzdata/America/Fort_Nelson @@ -0,0 +1,151 @@ +# created by tools/tclZIC.tcl - do not edit + +set TZData(:America/Fort_Nelson) { + {-9223372036854775808 -29447 0 LMT} + {-2713880953 -28800 0 PST} + {-1632060000 -25200 1 PDT} + {-1615129200 -28800 0 PST} + {-880207200 -25200 1 PWT} + {-769395600 -25200 1 PPT} + {-765385200 -28800 0 PST} + {-757353600 -28800 0 PST} + {-725817600 -28800 0 PST} + {-715788000 -25200 1 PDT} + {-702486000 -28800 0 PST} + {-684338400 -25200 1 PDT} + {-671036400 -28800 0 PST} + {-652888800 -25200 1 PDT} + {-639586800 -28800 0 PST} + {-620834400 -25200 1 PDT} + {-608137200 -28800 0 PST} + {-589384800 -25200 1 PDT} + {-576082800 -28800 0 PST} + {-557935200 -25200 1 PDT} + {-544633200 -28800 0 PST} + {-526485600 -25200 1 PDT} + {-513183600 -28800 0 PST} + {-495036000 -25200 1 PDT} + {-481734000 -28800 0 PST} + {-463586400 -25200 1 PDT} + {-450284400 -28800 0 PST} + {-431532000 -25200 1 PDT} + {-418230000 -28800 0 PST} + {-400082400 -25200 1 PDT} + {-386780400 -28800 0 PST} + {-368632800 -25200 1 PDT} + {-355330800 -28800 0 PST} + {-337183200 -25200 1 PDT} + {-323881200 -28800 0 PST} + {-305733600 -25200 1 PDT} + {-292431600 -28800 0 PST} + {-273679200 -25200 1 PDT} + {-260982000 -28800 0 PST} + {-242229600 -25200 1 PDT} + {-226508400 -28800 0 PST} + {-210780000 -25200 1 PDT} + {-195058800 -28800 0 PST} + {-179330400 -25200 1 PDT} + {-163609200 -28800 0 PST} + {-147880800 -25200 1 PDT} + {-131554800 -28800 0 PST} + {-116431200 -25200 1 PDT} + {-100105200 -28800 0 PST} + {-84376800 -25200 1 PDT} + {-68655600 -28800 0 PST} + {-52927200 -25200 1 PDT} + {-37206000 -28800 0 PST} + {-21477600 -25200 1 PDT} + {-5756400 -28800 0 PST} + {9972000 -25200 1 PDT} + {25693200 -28800 0 PST} + {41421600 -25200 1 PDT} + {57747600 -28800 0 PST} + {73476000 -25200 1 PDT} + {89197200 -28800 0 PST} + {104925600 -25200 1 PDT} + {120646800 -28800 0 PST} + {136375200 -25200 1 PDT} + {152096400 -28800 0 PST} + {167824800 -25200 1 PDT} + {183546000 -28800 0 PST} + {199274400 -25200 1 PDT} + {215600400 -28800 0 PST} + {230724000 -25200 1 PDT} + {247050000 -28800 0 PST} + {262778400 -25200 1 PDT} + {278499600 -28800 0 PST} + {294228000 -25200 1 PDT} + {309949200 -28800 0 PST} + {325677600 -25200 1 PDT} + {341398800 -28800 0 PST} + {357127200 -25200 1 PDT} + {372848400 -28800 0 PST} + {388576800 -25200 1 PDT} + {404902800 -28800 0 PST} + {420026400 -25200 1 PDT} + {436352400 -28800 0 PST} + {452080800 -25200 1 PDT} + {467802000 -28800 0 PST} + {483530400 -25200 1 PDT} + {499251600 -28800 0 PST} + {514980000 -25200 1 PDT} + {530701200 -28800 0 PST} + {536486400 -28800 0 PST} + {544615200 -25200 1 PDT} + {562150800 -28800 0 PST} + {576064800 -25200 1 PDT} + {594205200 -28800 0 PST} + {607514400 -25200 1 PDT} + {625654800 -28800 0 PST} + {638964000 -25200 1 PDT} + {657104400 -28800 0 PST} + {671018400 -25200 1 PDT} + {688554000 -28800 0 PST} + {702468000 -25200 1 PDT} + {720003600 -28800 0 PST} + {733917600 -25200 1 PDT} + {752058000 -28800 0 PST} + {765367200 -25200 1 PDT} + {783507600 -28800 0 PST} + {796816800 -25200 1 PDT} + {814957200 -28800 0 PST} + {828871200 -25200 1 PDT} + {846406800 -28800 0 PST} + {860320800 -25200 1 PDT} + {877856400 -28800 0 PST} + {891770400 -25200 1 PDT} + {909306000 -28800 0 PST} + {923220000 -25200 1 PDT} + {941360400 -28800 0 PST} + {954669600 -25200 1 PDT} + {972810000 -28800 0 PST} + {986119200 -25200 1 PDT} + {1004259600 -28800 0 PST} + {1018173600 -25200 1 PDT} + {1035709200 -28800 0 PST} + {1049623200 -25200 1 PDT} + {1067158800 -28800 0 PST} + {1081072800 -25200 1 PDT} + {1099213200 -28800 0 PST} + {1112522400 -25200 1 PDT} + {1130662800 -28800 0 PST} + {1143972000 -25200 1 PDT} + {1162112400 -28800 0 PST} + {1173607200 -25200 1 PDT} + {1194166800 -28800 0 PST} + {1205056800 -25200 1 PDT} + {1225616400 -28800 0 PST} + {1236506400 -25200 1 PDT} + {1257066000 -28800 0 PST} + {1268560800 -25200 1 PDT} + {1289120400 -28800 0 PST} + {1300010400 -25200 1 PDT} + {1320570000 -28800 0 PST} + {1331460000 -25200 1 PDT} + {1352019600 -28800 0 PST} + {1362909600 -25200 1 PDT} + {1383469200 -28800 0 PST} + {1394359200 -25200 1 PDT} + {1414918800 -28800 0 PST} + {1425808800 -25200 0 MST} +} diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul index 7cb4820..8eadbc3 100644 --- a/library/tzdata/Europe/Istanbul +++ b/library/tzdata/Europe/Istanbul @@ -133,7 +133,8 @@ set TZData(:Europe/Istanbul) { {1396227600 10800 0 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} - {1445734800 7200 0 EET} + {1445734800 10800 1 EEST} + {1446944400 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji index 4aae330..8f8b12f 100644 --- a/library/tzdata/Pacific/Fiji +++ b/library/tzdata/Pacific/Fiji @@ -20,9 +20,9 @@ set TZData(:Pacific/Fiji) { {1414850400 46800 1 FJST} {1421503200 43200 0 FJT} {1446300000 46800 1 FJST} - {1453557600 43200 0 FJT} + {1452952800 43200 0 FJT} {1478354400 46800 1 FJST} - {1485007200 43200 0 FJT} + {1484402400 43200 0 FJT} {1509804000 46800 1 FJST} {1516456800 43200 0 FJT} {1541253600 46800 1 FJST} @@ -30,11 +30,11 @@ set TZData(:Pacific/Fiji) { {1572703200 46800 1 FJST} {1579356000 43200 0 FJT} {1604152800 46800 1 FJST} - {1611410400 43200 0 FJT} + {1610805600 43200 0 FJT} {1636207200 46800 1 FJST} - {1642860000 43200 0 FJT} + {1642255200 43200 0 FJT} {1667656800 46800 1 FJST} - {1674309600 43200 0 FJT} + {1673704800 43200 0 FJT} {1699106400 46800 1 FJST} {1705759200 43200 0 FJT} {1730556000 46800 1 FJST} @@ -42,9 +42,9 @@ set TZData(:Pacific/Fiji) { {1762005600 46800 1 FJST} {1768658400 43200 0 FJT} {1793455200 46800 1 FJST} - {1800712800 43200 0 FJT} + {1800108000 43200 0 FJT} {1825509600 46800 1 FJST} - {1832162400 43200 0 FJT} + {1831557600 43200 0 FJT} {1856959200 46800 1 FJST} {1863612000 43200 0 FJT} {1888408800 46800 1 FJST} @@ -54,9 +54,9 @@ set TZData(:Pacific/Fiji) { {1951308000 46800 1 FJST} {1957960800 43200 0 FJT} {1983362400 46800 1 FJST} - {1990015200 43200 0 FJT} + {1989410400 43200 0 FJT} {2014812000 46800 1 FJST} - {2021464800 43200 0 FJT} + {2020860000 43200 0 FJT} {2046261600 46800 1 FJST} {2052914400 43200 0 FJT} {2077711200 46800 1 FJST} @@ -64,11 +64,11 @@ set TZData(:Pacific/Fiji) { {2109160800 46800 1 FJST} {2115813600 43200 0 FJT} {2140610400 46800 1 FJST} - {2147868000 43200 0 FJT} + {2147263200 43200 0 FJT} {2172664800 46800 1 FJST} - {2179317600 43200 0 FJT} + {2178712800 43200 0 FJT} {2204114400 46800 1 FJST} - {2210767200 43200 0 FJT} + {2210162400 43200 0 FJT} {2235564000 46800 1 FJST} {2242216800 43200 0 FJT} {2267013600 46800 1 FJST} @@ -76,9 +76,9 @@ set TZData(:Pacific/Fiji) { {2298463200 46800 1 FJST} {2305116000 43200 0 FJT} {2329912800 46800 1 FJST} - {2337170400 43200 0 FJT} + {2336565600 43200 0 FJT} {2361967200 46800 1 FJST} - {2368620000 43200 0 FJT} + {2368015200 43200 0 FJT} {2393416800 46800 1 FJST} {2400069600 43200 0 FJT} {2424866400 46800 1 FJST} @@ -86,11 +86,11 @@ set TZData(:Pacific/Fiji) { {2456316000 46800 1 FJST} {2462968800 43200 0 FJT} {2487765600 46800 1 FJST} - {2495023200 43200 0 FJT} + {2494418400 43200 0 FJT} {2519820000 46800 1 FJST} - {2526472800 43200 0 FJT} + {2525868000 43200 0 FJT} {2551269600 46800 1 FJST} - {2557922400 43200 0 FJT} + {2557317600 43200 0 FJT} {2582719200 46800 1 FJST} {2589372000 43200 0 FJT} {2614168800 46800 1 FJST} @@ -98,9 +98,9 @@ set TZData(:Pacific/Fiji) { {2645618400 46800 1 FJST} {2652271200 43200 0 FJT} {2677068000 46800 1 FJST} - {2684325600 43200 0 FJT} + {2683720800 43200 0 FJT} {2709122400 46800 1 FJST} - {2715775200 43200 0 FJT} + {2715170400 43200 0 FJT} {2740572000 46800 1 FJST} {2747224800 43200 0 FJT} {2772021600 46800 1 FJST} @@ -110,9 +110,9 @@ set TZData(:Pacific/Fiji) { {2834920800 46800 1 FJST} {2841573600 43200 0 FJT} {2866975200 46800 1 FJST} - {2873628000 43200 0 FJT} + {2873023200 43200 0 FJT} {2898424800 46800 1 FJST} - {2905077600 43200 0 FJT} + {2904472800 43200 0 FJT} {2929874400 46800 1 FJST} {2936527200 43200 0 FJT} {2961324000 46800 1 FJST} @@ -120,11 +120,11 @@ set TZData(:Pacific/Fiji) { {2992773600 46800 1 FJST} {2999426400 43200 0 FJT} {3024223200 46800 1 FJST} - {3031480800 43200 0 FJT} + {3030876000 43200 0 FJT} {3056277600 46800 1 FJST} - {3062930400 43200 0 FJT} + {3062325600 43200 0 FJT} {3087727200 46800 1 FJST} - {3094380000 43200 0 FJT} + {3093775200 43200 0 FJT} {3119176800 46800 1 FJST} {3125829600 43200 0 FJT} {3150626400 46800 1 FJST} @@ -132,9 +132,9 @@ set TZData(:Pacific/Fiji) { {3182076000 46800 1 FJST} {3188728800 43200 0 FJT} {3213525600 46800 1 FJST} - {3220783200 43200 0 FJT} + {3220178400 43200 0 FJT} {3245580000 46800 1 FJST} - {3252232800 43200 0 FJT} + {3251628000 43200 0 FJT} {3277029600 46800 1 FJST} {3283682400 43200 0 FJT} {3308479200 46800 1 FJST} @@ -142,11 +142,11 @@ set TZData(:Pacific/Fiji) { {3339928800 46800 1 FJST} {3346581600 43200 0 FJT} {3371378400 46800 1 FJST} - {3378636000 43200 0 FJT} + {3378031200 43200 0 FJT} {3403432800 46800 1 FJST} - {3410085600 43200 0 FJT} + {3409480800 43200 0 FJT} {3434882400 46800 1 FJST} - {3441535200 43200 0 FJT} + {3440930400 43200 0 FJT} {3466332000 46800 1 FJST} {3472984800 43200 0 FJT} {3497781600 46800 1 FJST} @@ -154,9 +154,9 @@ set TZData(:Pacific/Fiji) { {3529231200 46800 1 FJST} {3535884000 43200 0 FJT} {3560680800 46800 1 FJST} - {3567938400 43200 0 FJT} + {3567333600 43200 0 FJT} {3592735200 46800 1 FJST} - {3599388000 43200 0 FJT} + {3598783200 43200 0 FJT} {3624184800 46800 1 FJST} {3630837600 43200 0 FJT} {3655634400 46800 1 FJST} @@ -166,9 +166,9 @@ set TZData(:Pacific/Fiji) { {3718533600 46800 1 FJST} {3725186400 43200 0 FJT} {3750588000 46800 1 FJST} - {3757240800 43200 0 FJT} + {3756636000 43200 0 FJT} {3782037600 46800 1 FJST} - {3788690400 43200 0 FJT} + {3788085600 43200 0 FJT} {3813487200 46800 1 FJST} {3820140000 43200 0 FJT} {3844936800 46800 1 FJST} @@ -176,11 +176,11 @@ set TZData(:Pacific/Fiji) { {3876386400 46800 1 FJST} {3883039200 43200 0 FJT} {3907836000 46800 1 FJST} - {3915093600 43200 0 FJT} + {3914488800 43200 0 FJT} {3939890400 46800 1 FJST} - {3946543200 43200 0 FJT} + {3945938400 43200 0 FJT} {3971340000 46800 1 FJST} - {3977992800 43200 0 FJT} + {3977388000 43200 0 FJT} {4002789600 46800 1 FJST} {4009442400 43200 0 FJT} {4034239200 46800 1 FJST} diff --git a/library/tzdata/Pacific/Norfolk b/library/tzdata/Pacific/Norfolk index a8fac15..b12ab8c 100644 --- a/library/tzdata/Pacific/Norfolk +++ b/library/tzdata/Pacific/Norfolk @@ -4,4 +4,7 @@ set TZData(:Pacific/Norfolk) { {-9223372036854775808 40312 0 LMT} {-2177493112 40320 0 NMT} {-599656320 41400 0 NFT} + {152029800 45000 1 NFST} + {162912600 41400 0 NFT} + {1443882600 39600 0 NFT} } -- cgit v0.12 From d2b7a7797a402493c3e257f8c83b27111c0770c0 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 28 Oct 2015 21:15:21 +0000 Subject: Expose some of the TclBN operations through the internal API, so clients of the bignum code don't need to use tclTomMath.h directly. --- generic/tclInt.h | 7 +------ generic/tclTomMath.decls | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 356d250..f9d2edf 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4435,17 +4435,12 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, /* *---------------------------------------------------------------------- * - * Core procedures added to libtommath for bignum manipulation. + * Core procedure added to libtommath for bignum manipulation. * *---------------------------------------------------------------------- */ MODULE_SCOPE Tcl_PackageInitProc TclTommath_Init; -MODULE_SCOPE void TclBNInitBignumFromLong(mp_int *bignum, long initVal); -MODULE_SCOPE void TclBNInitBignumFromWideInt(mp_int *bignum, - Tcl_WideInt initVal); -MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, - Tcl_WideUInt initVal); /* *---------------------------------------------------------------------- diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index ea3abb1..8d9e05f 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -1,9 +1,8 @@ # tclTomMath.decls -- # -# This file contains the declarations for the functions in -# 'libtommath' that are contained within the Tcl library. -# This file is used to generate the 'tclTomMathDecls.h' and -# 'tclTomMathStub.c' files. +# This file contains the declarations for the functions in 'libtommath' +# that are contained within the Tcl library. This file is used to +# generate the 'tclTomMathDecls.h' and 'tclTomMathStub.c' files. # # If you edit this file, advance the revision number (and the epoch # if the new stubs are not backward compatible) in tclTomMathDecls.h @@ -221,3 +220,19 @@ declare 62 { declare 63 { int TclBN_mp_cnt_lsb(const mp_int *a) } + +# Formerly internal API to allow initialisation of bignums without knowing the +# typedefs of how a bignum works internally. +declare 64 { + void TclBNInitBignumFromLong(mp_int *bignum, long initVal) +} +declare 65 { + void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal) +} +declare 66 { + void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal) +} + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From 573cabc6d240f1e84a271373810ae254a2dd4791 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 28 Oct 2015 21:15:52 +0000 Subject: make genstubs --- generic/tclStubInit.c | 3 +++ generic/tclTomMathDecls.h | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 7d44163..5b7a1cd 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -746,6 +746,9 @@ const TclTomMathStubs tclTomMathStubs = { TclBN_mp_init_set_int, /* 61 */ TclBN_mp_set_int, /* 62 */ TclBN_mp_cnt_lsb, /* 63 */ + TclBNInitBignumFromLong, /* 64 */ + TclBNInitBignumFromWideInt, /* 65 */ + TclBNInitBignumFromWideUInt, /* 66 */ }; static const TclStubHooks tclStubHooks = { diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 69b095c..2ce9d5a 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -279,6 +279,14 @@ EXTERN int TclBN_mp_init_set_int(mp_int *a, unsigned long i); EXTERN int TclBN_mp_set_int(mp_int *a, unsigned long i); /* 63 */ EXTERN int TclBN_mp_cnt_lsb(const mp_int *a); +/* 64 */ +EXTERN void TclBNInitBignumFromLong(mp_int *bignum, long initVal); +/* 65 */ +EXTERN void TclBNInitBignumFromWideInt(mp_int *bignum, + Tcl_WideInt initVal); +/* 66 */ +EXTERN void TclBNInitBignumFromWideUInt(mp_int *bignum, + Tcl_WideUInt initVal); typedef struct TclTomMathStubs { int magic; @@ -348,6 +356,9 @@ typedef struct TclTomMathStubs { int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */ int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */ int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */ + void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */ + void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */ + void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */ } TclTomMathStubs; extern const TclTomMathStubs *tclTomMathStubsPtr; @@ -490,6 +501,12 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; (tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */ #define TclBN_mp_cnt_lsb \ (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */ +#define TclBNInitBignumFromLong \ + (tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */ +#define TclBNInitBignumFromWideInt \ + (tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */ +#define TclBNInitBignumFromWideUInt \ + (tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */ #endif /* defined(USE_TCL_STUBS) */ -- cgit v0.12 From c5b0b72ed7cbfd413896d9c9b0cb7bdcf521fc53 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 10 Nov 2015 16:31:29 +0000 Subject: [261a8a79f0] Integer overflow leads to segfault. --- generic/tclIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 9a4735f..7bc849e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -5938,7 +5938,7 @@ TranslateInputEOL( break; default: /* In other modes, at most 2 src bytes become a dst byte. */ - if (srcLen > 2 * dstLen) { + if (srcLen/2 > dstLen) { srcLen = 2 * dstLen; } break; -- cgit v0.12 From f84d09bdd759fbee98108d0a097f322255fdf0e3 Mon Sep 17 00:00:00 2001 From: max Date: Wed, 11 Nov 2015 09:56:41 +0000 Subject: Remove unused calculation of the result set size from TclCreateSocketAddress() --- generic/tclIOSock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index d578d19..c5b7d28 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -171,7 +171,7 @@ TclCreateSocketAddress( char *native = NULL, portbuf[TCL_INTEGER_SPACE], *portstring; const char *family = NULL; Tcl_DString ds; - int result, i; + int result; if (host != NULL) { native = Tcl_UtfToExternalDString(NULL, host, -1, &ds); @@ -279,11 +279,6 @@ TclCreateSocketAddress( *addrlist = v4head; } } - i = 0; - for (p = *addrlist; p != NULL; p = p->ai_next) { - i++; - } - return 1; } -- cgit v0.12 From e93e78ae999879629f4db62379c05fd53ca4db57 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Nov 2015 08:40:54 +0000 Subject: Fix [https://www.sqlite.org/src/info/34eb6911afee09e7|34eb6911af], taken over from SQLite: Fix uses of ctype functions (ex: isspace()) on signed characters in test programs and in some obscure extensions. No changes to the core. --- win/nmakehlp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index d0edcf0..84cf75c 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -498,9 +498,10 @@ GetVersionFromFile( p = strstr(szBuffer, match); if (p != NULL) { /* - * Skip to first digit. + * Skip to first digit after the match. */ + p += strlen(match); while (*p && !isdigit(*p)) { ++p; } @@ -605,8 +606,8 @@ SubstituteFile( sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { - char *ks, *ke, *vs, *ve; - ks = szBuffer; + unsigned char *ks, *ke, *vs, *ve; + ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; @@ -615,7 +616,7 @@ SubstituteFile( ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; - list_insert(&substPtr, ks, vs); + list_insert(&substPtr, (char*)ks, (char*)vs); } fclose(sp); } @@ -630,11 +631,11 @@ SubstituteFile( } } #endif - + /* * Run the substitutions over each line of the input */ - + while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { @@ -654,7 +655,7 @@ SubstituteFile( } printf(szBuffer); } - + list_free(&substPtr); } fclose(fp); -- cgit v0.12 From 31b415218813b465bfd99d4d79ae85e95c90028f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 16 Nov 2015 10:32:40 +0000 Subject: =?UTF-8?q?Fix=20--enable-symbols=20build=20on=20Cygwin.=20Reporte?= =?UTF-8?q?d=20by=20Fran=C3=A7ois=20Vogel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unix/Makefile.in | 2 +- win/Makefile.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 1f2cd77..84d0391 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -560,7 +560,7 @@ ${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} @if test "x${LIB_FILE}" = "xlibtcl${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ - (cd ${TOP_DIR}/win; ${MAKE} libtclstub${MAJOR_VERSION}${MINOR_VERSION}.a); \ + (cd ${TOP_DIR}/win; ${MAKE} winextensions); \ fi rm -f $@ @MAKE_STUB_LIB@ diff --git a/win/Makefile.in b/win/Makefile.in index e9a28c4..ada9448 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -400,6 +400,8 @@ winhelp: $(ROOT_DIR)/tools/man2help.tcl $(MAN2TCL) ./$(TCLSH) "$(ROOT_DIR_NATIVE)"/tools/man2help.tcl tcl "$(VER)" $(TCL_DOCS) hcw /c /e tcl.hpj +winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} + $(MAN2TCL): $(ROOT_DIR)/tools/man2tcl.c $(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(ROOT_DIR_NATIVE)"/tools/man2tcl.c -- cgit v0.12 From 0c95d1d7c2d07e8a422b8af055160e8009e7eeb4 Mon Sep 17 00:00:00 2001 From: oehhar Date: Tue, 17 Nov 2015 17:01:58 +0000 Subject: Spanish translation of example corrected --- doc/msgcat.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index 7e46528..34e153d 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -384,7 +384,7 @@ the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" -- cgit v0.12 From 5498d8aaa43327e94fd652a66fde74f4187452db Mon Sep 17 00:00:00 2001 From: oehhar Date: Tue, 17 Nov 2015 17:07:33 +0000 Subject: Spanish translation of example corrected --- doc/msgcat.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/msgcat.n b/doc/msgcat.n index bae6dbe..b4f7140 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -321,7 +321,7 @@ the package. For example, a short \fBes.msg\fR might contain: .PP .CS namespace eval ::mypackage { - \fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!" + \fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis" } .CE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" -- cgit v0.12 From c32d032cbd7947d9e64e931df87fc4f374d81e7f Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Nov 2015 15:47:30 +0000 Subject: [40f628e8e3] Tcl_ListObjReplace() callers need to handle TCL_ERROR. --- generic/tclCmdIL.c | 10 ++++++++-- generic/tclUtil.c | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index ea9c1e4..02e5812 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2233,7 +2233,10 @@ Tcl_LinsertObjCmd( Tcl_ListObjAppendElement(NULL, listPtr, objv[3]); } else { - Tcl_ListObjReplace(NULL, listPtr, index, 0, (objc-3), &(objv[3])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, index, 0, + (objc-3), &(objv[3]))) { + return TCL_ERROR; + } } /* @@ -2598,7 +2601,10 @@ Tcl_LreplaceObjCmd( * optimize this case away. */ - Tcl_ListObjReplace(NULL, listPtr, first, numToDelete, objc-4, &(objv[4])); + if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, first, numToDelete, + objc-4, &(objv[4]))) { + return TCL_ERROR; + } /* * Set the interpreter's object result. diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 69d0b17..bc1490e 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1791,7 +1791,12 @@ Tcl_ConcatObj( TclListObjGetElements(NULL, objPtr, &listc, &listv); if (listc) { if (resPtr) { - Tcl_ListObjReplace(NULL, resPtr, INT_MAX, 0, listc, listv); + if (TCL_OK != Tcl_ListObjReplace(NULL, resPtr, + INT_MAX, 0, listc, listv)) { + /* Abandon ship! */ + Tcl_DecrRefCount(resPtr); + goto slow; + } } else { resPtr = TclListObjCopy(NULL, objPtr); } @@ -1808,6 +1813,7 @@ Tcl_ConcatObj( * the slow way, using the string representations. */ + slow: /* First try to pre-allocate the size required */ for (i = 0; i < objc; i++) { element = TclGetStringFromObj(objv[i], &elemLength); -- cgit v0.12 From dfbac0054227702fab645e6c03d08c35a8dd9b7c Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Nov 2015 16:58:11 +0000 Subject: [3293874] Simplified fix (not backport). Also detect >LIST_MAX early. --- generic/tclListObj.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 289cf2d..c4b5cfc 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -854,8 +854,13 @@ Tcl_ListObjReplace( count = numElems - first; } + if (objc > LIST_MAX - (numElems - count)) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max length of a Tcl list (%d elements) exceeded", LIST_MAX)); + return TCL_ERROR; + } isShared = (listRepPtr->refCount > 1); - numRequired = numElems - count + objc; + numRequired = numElems - count + objc; /* Known <= LIST_MAX */ for (i = 0; i < objc; i++) { Tcl_IncrRefCount(objv[i]); @@ -906,6 +911,8 @@ Tcl_ListObjReplace( listRepPtr = AttemptNewList(interp, newMax, NULL); if (listRepPtr == NULL) { + listRepPtr = AttemptNewList(interp, numRequired, NULL); + if (listRepPtr == NULL) { for (i = 0; i < objc; i++) { /* See bug 3598580 */ #if TCL_MAJOR_VERSION > 8 @@ -916,6 +923,7 @@ Tcl_ListObjReplace( } return TCL_ERROR; } + } listPtr->internalRep.twoPtrValue.ptr1 = (void *) listRepPtr; listRepPtr->refCount++; -- cgit v0.12 From 6b4bc6bb8d46722088d73bd4a93f51e7fc65dbf4 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 21 Nov 2015 22:22:49 +0000 Subject: [3d96b7076e] Prevent crashes when destroying an object's class inside a method call. --- generic/tclOO.c | 20 +++++++++++++++---- generic/tclOODefineCmds.c | 15 ++++++++++---- generic/tclOOInfo.c | 12 +++++++++++ generic/tclOOInt.h | 3 +++ tests/oo.test | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 8 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 84bb85a..5fca220 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -951,6 +951,16 @@ ReleaseClassContents( } if (!IsRootClass(oPtr)) { FOREACH(instancePtr, clsPtr->instances) { + int j; + if (instancePtr->selfCls == clsPtr) { + instancePtr->flags |= CLASS_GONE; + } + for(j=0 ; jmixins.num ; j++) { + Class *mixin = instancePtr->mixins.list[j]; + if (mixin == clsPtr) { + instancePtr->mixins.list[j] = NULL; + } + } if (instancePtr != NULL && !IsRoot(instancePtr)) { AddRef(instancePtr); } @@ -1131,12 +1141,14 @@ ObjectNamespaceDeleted( * methods on the object. */ - if (!IsRootObject(oPtr)) { + if (!IsRootObject(oPtr) && !(oPtr->flags & CLASS_GONE)) { TclOORemoveFromInstances(oPtr, oPtr->selfCls); } FOREACH(mixinPtr, oPtr->mixins) { - TclOORemoveFromInstances(oPtr, mixinPtr); + if (mixinPtr) { + TclOORemoveFromInstances(oPtr, mixinPtr); + } } if (i) { ckfree(oPtr->mixins.list); @@ -1908,13 +1920,13 @@ Tcl_CopyObjectInstance( */ FOREACH(mixinPtr, o2Ptr->mixins) { - if (mixinPtr != o2Ptr->selfCls) { + if (mixinPtr && mixinPtr != o2Ptr->selfCls) { TclOORemoveFromInstances(o2Ptr, mixinPtr); } } DUPLICATE(o2Ptr->mixins, oPtr->mixins, Class *); FOREACH(mixinPtr, o2Ptr->mixins) { - if (mixinPtr != o2Ptr->selfCls) { + if (mixinPtr && mixinPtr != o2Ptr->selfCls) { TclOOAddToInstances(o2Ptr, mixinPtr); } } diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index 85f6c31..c880754 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -323,7 +323,9 @@ TclOOObjectSetMixins( if (numMixins == 0) { if (oPtr->mixins.num != 0) { FOREACH(mixinPtr, oPtr->mixins) { - TclOORemoveFromInstances(oPtr, mixinPtr); + if (mixinPtr) { + TclOORemoveFromInstances(oPtr, mixinPtr); + } } ckfree(oPtr->mixins.list); oPtr->mixins.num = 0; @@ -332,7 +334,7 @@ TclOOObjectSetMixins( } else { if (oPtr->mixins.num != 0) { FOREACH(mixinPtr, oPtr->mixins) { - if (mixinPtr != oPtr->selfCls) { + if (mixinPtr && mixinPtr != oPtr->selfCls) { TclOORemoveFromInstances(oPtr, mixinPtr); } } @@ -1213,6 +1215,9 @@ TclOODefineClassObjCmd( TclOORemoveFromInstances(oPtr, oPtr->selfCls); oPtr->selfCls = clsPtr; TclOOAddToInstances(oPtr, oPtr->selfCls); + if (!(clsPtr->thisPtr->flags & OBJECT_DELETED)) { + oPtr->flags &= ~CLASS_GONE; + } if (oPtr->classPtr != NULL) { BumpGlobalEpoch(interp, oPtr->classPtr); } else { @@ -2509,8 +2514,10 @@ ObjMixinGet( resultObj = Tcl_NewObj(); FOREACH(mixinPtr, oPtr->mixins) { - Tcl_ListObjAppendElement(NULL, resultObj, - TclOOObjectName(interp, mixinPtr->thisPtr)); + if (mixinPtr) { + Tcl_ListObjAppendElement(NULL, resultObj, + TclOOObjectName(interp, mixinPtr->thisPtr)); + } } Tcl_SetObjResult(interp, resultObj); return TCL_OK; diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index 0c22bcf..76eaef5 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -196,6 +196,9 @@ InfoObjectClassCmd( } FOREACH(mixinPtr, oPtr->mixins) { + if (!mixinPtr) { + continue; + } if (TclOOIsReachable(o2clsPtr, mixinPtr)) { Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); return TCL_OK; @@ -467,6 +470,9 @@ InfoObjectIsACmd( Class *mixinPtr; FOREACH(mixinPtr, oPtr->mixins) { + if (!mixinPtr) { + continue; + } if (TclOOIsReachable(o2Ptr->classPtr, mixinPtr)) { result = 1; break; @@ -665,6 +671,9 @@ InfoObjectMixinsCmd( resultObj = Tcl_NewObj(); FOREACH(mixinPtr, oPtr->mixins) { + if (!mixinPtr) { + continue; + } Tcl_ListObjAppendElement(NULL, resultObj, TclOOObjectName(interp, mixinPtr->thisPtr)); } @@ -1281,6 +1290,9 @@ InfoClassMixinsCmd( resultObj = Tcl_NewObj(); FOREACH(mixinPtr, clsPtr->mixins) { + if (!mixinPtr) { + continue; + } Tcl_ListObjAppendElement(NULL, resultObj, TclOOObjectName(interp, mixinPtr->thisPtr)); } diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 208e32c..b75ffdb 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -193,6 +193,9 @@ typedef struct Object { * destroyed. */ #define DESTRUCTOR_CALLED 2 /* Flag to say that the destructor has been * called. */ +#define CLASS_GONE 4 /* Indicates that the class of this object has + * been deleted, and so the object should not + * attempt to remove itself from its class. */ #define ROOT_OBJECT 0x1000 /* Flag to say that this object is the root of * the class hierarchy and should be treated * specially during teardown. */ diff --git a/tests/oo.test b/tests/oo.test index c83e015..2112f10 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -638,6 +638,57 @@ test oo-3.9 {Bug 2944404: deleting the object in the destructor} -setup { } -cleanup { cls destroy } -result {in destructor} +test oo-3.10 {Bug 3d96b7076e: killing the object's class in a method call} -setup { + oo::class create Super +} -body { + # Only reliably failed in a memdebug build + oo::class create Cls { + superclass Super + method mthd {} { + [self class] destroy + return ok + } + } + [Cls new] mthd +} -cleanup { + Super destroy +} -result ok +test oo-3.11 {Bug 3d96b7076e: killing the object's class in a method call} -setup { + oo::class create Super + oo::class create Sub { + superclass Super + } +} -body { + # Only reliably failed in a memdebug build + oo::class create Cls { + superclass Super + method mthd {} { + oo::objdefine [self] class Sub + Cls destroy + return ok + } + } + [Cls new] mthd +} -cleanup { + Super destroy +} -result ok +test oo-3.12 {Bug 3d96b7076e: killing the object's class in a method call} -setup { + oo::class create Super +} -body { + # Only reliably failed in a memdebug build + oo::class create Cls { + superclass Super + method mthd {} { + [self class] destroy + return ok + } + } + set o [Super new] + oo::objdefine $o mixin Cls + $o mthd +} -cleanup { + Super destroy +} -result ok test oo-4.1 {basic test of OO functionality: export} { set o [oo::object new] -- cgit v0.12 From 5eeef96ee9e6fbb573a438338662fea9ca7c0efd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 22 Nov 2015 21:02:29 +0000 Subject: Cherrypick [812a81812ebf89d2416059d45fabd27e45603f5e|812a81812e]: Turn off NRE asserts by default. About a 5% speedup on [clock format]. --- generic/regc_nfa.c | 12 ++++++------ generic/tclBasic.c | 3 --- generic/tclExecute.c | 3 --- generic/tclInt.h | 4 +++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 0e0343e..088c6c0 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -293,7 +293,7 @@ newarc( } } } - + /* no dup, so create the arc */ createarc(nfa, t, co, from, to); } @@ -657,7 +657,7 @@ sortins_cmp( } return 0; } - + /* * sortouts - sort the out arcs of a state by to/color/type */ @@ -2020,7 +2020,7 @@ fixempties( arcarray[arccount++] = a; } } - + /* Reset the tmp fields as we walk back */ nexts = s2->tmp; s2->tmp = NULL; @@ -2042,7 +2042,7 @@ fixempties( } inarcsorig[s->no] = a; } - + FREE(arcarray); FREE(inarcsorig); @@ -2193,7 +2193,7 @@ fixconstraintloops( dropstate(nfa, s); } } - + /* Nothing to do if no remaining constraint arcs */ if (NISERR() || !hasconstraints) { return; @@ -2909,7 +2909,7 @@ carc_cmp( { const struct carc *aa = (const struct carc *) a; const struct carc *bb = (const struct carc *) b; - + if (aa->co < bb->co) { return -1; } diff --git a/generic/tclBasic.c b/generic/tclBasic.c index a09bf10..5c5bc64 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -22,10 +22,7 @@ #include "tclCompile.h" #include "tommath.h" #include - -#if NRE_ENABLE_ASSERTS #include -#endif #define INTERP_STACK_INITIAL_SIZE 2000 #define CORO_STACK_INITIAL_SIZE 200 diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7f65262..b10af65 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -20,10 +20,7 @@ #include "tclOOInt.h" #include "tommath.h" #include - -#if NRE_ENABLE_ASSERTS #include -#endif /* * Hack to determine whether we may expect IEEE floating point. The hack is diff --git a/generic/tclInt.h b/generic/tclInt.h index f9d2edf..082fab4 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4791,7 +4791,9 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn)); */ #define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */ -#define NRE_ENABLE_ASSERTS 1 +#ifndef NRE_ENABLE_ASSERTS +#define NRE_ENABLE_ASSERTS 0 +#endif /* * This is the main data struct for representing NR commands. It is designed -- cgit v0.12 From 48ac4215cf78865b39eadc4341f8c59def82aa12 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 24 Nov 2015 09:00:27 +0000 Subject: Make ::tcl::tm::roots work for alpha/beta Tcl releases. (backported from "novem", will be needed anyway for whatever future developments) --- library/tm.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/tm.tcl b/library/tm.tcl index 55efda6..66c56a1 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -354,7 +354,7 @@ proc ::tcl::tm::Defaults {} { # Calls 'path add' to paths to the list of module search paths. proc ::tcl::tm::roots {paths} { - lassign [split [package present Tcl] .] major minor + regexp {^(\d+)\.(\d+)} [package present Tcl] - major minor foreach pa $paths { set p [file join $pa tcl$major] for {set n $minor} {$n >= 0} {incr n -1} { -- cgit v0.12 From 81929af166648538e5b049b7d0e1cd2b24906d08 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 24 Nov 2015 15:05:15 +0000 Subject: Fix comments at the top of the *.decls files, which are not correct any more for a long long time. --- generic/tcl.decls | 4 ++-- generic/tclInt.decls | 5 ++--- generic/tclTomMath.decls | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index 28cee54..92ccdcf 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2,8 +2,8 @@ # # This file contains the declarations for all supported public # functions that are exported by the Tcl library via the stubs table. -# This file is used to generate the tclDecls.h, tclPlatDecls.h, -# tclStub.c, and tclPlatStub.c files. +# This file is used to generate the tclDecls.h, tclPlatDecls.h +# and tclStubInit.c files. # # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved. diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 102d04b..920116c 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -2,9 +2,8 @@ # # This file contains the declarations for all unsupported # functions that are exported by the Tcl library. This file -# is used to generate the tclIntDecls.h, tclIntPlatDecls.h, -# tclIntStub.c, tclPlatStub.c, tclCompileDecls.h and tclCompileStub.c -# files +# is used to generate the tclIntDecls.h, tclIntPlatDecls.h +# and tclStubInit.c files # # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 1bfc443..ab39e83 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -3,7 +3,7 @@ # This file contains the declarations for the functions in # 'libtommath' that are contained within the Tcl library. # This file is used to generate the 'tclTomMathDecls.h' and -# 'tclTomMathStub.c' files. +# 'tclStubInit.c' files. # # If you edit this file, advance the revision number (and the epoch # if the new stubs are not backward compatible) in tclTomMathDecls.h -- cgit v0.12 From a90dcf7e3dbae2714513cbc09ec978dfcf21aa55 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Nov 2015 11:46:02 +0000 Subject: On cygwin, install libtcl8.5.dll.a in the {prefix}/lib directory. On win32, don't create empty {prefix}/lib/tcl8/8.2 and {prefix}/lib/tcl8/8.3 directories any more during installing. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- win/makefile.vc | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index 692b801..a90aff3 100755 --- a/unix/configure +++ b/unix/configure @@ -8880,7 +8880,7 @@ fi MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 7a0b677..a7faae5 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2069,7 +2069,7 @@ dnl # preprocessing tests use only CPPFLAGS. LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [ - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" ], [ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' diff --git a/win/makefile.vc b/win/makefile.vc index 267f53f..8c8ecdf 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1012,10 +1012,6 @@ install-libraries: tclConfig install-msgs install-tzdata $(MKDIR) "$(SCRIPT_INSTALL_DIR)" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8$(NULL)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8" - @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.2$(NULL)" \ - $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.2" - @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.3$(NULL)" \ - $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.3" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4$(NULL)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4\platform$(NULL)" \ -- cgit v0.12 From efe36a3e290e2f47f8bed9ca19569cf46d0079ce Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 30 Nov 2015 18:24:03 +0000 Subject: [32c5740a4d] Have Tcl_ListObjReplace() try to use realloc() for growing when it can do so. --- generic/tclListObj.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 0dfa845..14b8a14 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -857,7 +857,7 @@ Tcl_ListObjReplace( { List *listRepPtr; register Tcl_Obj **elemPtrs; - int numElems, numRequired, numAfterLast, start, i, j, isShared; + int needGrow, numElems, numRequired, numAfterLast, start, i, j, isShared; if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); @@ -913,12 +913,39 @@ Tcl_ListObjReplace( } isShared = (listRepPtr->refCount > 1); numRequired = numElems - count + objc; /* Known <= LIST_MAX */ + needGrow = numRequired > listRepPtr->maxElemCount; for (i = 0; i < objc; i++) { Tcl_IncrRefCount(objv[i]); } - if ((numRequired <= listRepPtr->maxElemCount) && !isShared) { + if (needGrow && !isShared) { + /* Try to use realloc */ + List *newPtr = NULL; + int attempt = 2 * numRequired; + if (attempt <= LIST_MAX) { + newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt)); + } + if (newPtr == NULL) { + attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH; + if (attempt > LIST_MAX) { + attempt = LIST_MAX; + } + newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt)); + } + if (newPtr == NULL) { + attempt = numRequired; + newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt)); + } + if (newPtr) { + listRepPtr = newPtr; + listPtr->internalRep.twoPtrValue.ptr1 = listRepPtr; + elemPtrs = &listRepPtr->elements; + listRepPtr->maxElemCount = attempt; + needGrow = numRequired > listRepPtr->maxElemCount; + } + } + if (!needGrow && !isShared) { int shift; /* @@ -955,7 +982,7 @@ Tcl_ListObjReplace( Tcl_Obj **oldPtrs = elemPtrs; int newMax; - if (numRequired > listRepPtr->maxElemCount){ + if (needGrow){ newMax = 2 * numRequired; } else { newMax = listRepPtr->maxElemCount; -- cgit v0.12 From 7b5ffe4a2c27ceb9b41422abe0a3a680dc345244 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Dec 2015 11:02:34 +0000 Subject: Fix 64-bit MSVC build without SDK: If the MSVC version is recent enough, compiling without SDK works fine (provided that the build is configured using "--enable-64bit"). --- win/configure | 12 ++++-------- win/tcl.m4 | 7 ++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/win/configure b/win/configure index 63d6765..090feaa 100755 --- a/win/configure +++ b/win/configure @@ -3722,15 +3722,11 @@ echo "${ECHO_T}using shared flags" >&6 ;; esac if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;} fi + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi LIBS="user32.lib advapi32.lib ws2_32.lib" diff --git a/win/tcl.m4 b/win/tcl.m4 index 2795086..006778c 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -815,12 +815,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; esac if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK]) fi + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi LIBS="user32.lib advapi32.lib ws2_32.lib" -- cgit v0.12 From 003b3000368a5f8752fcee1444cf4ec1cee6fe62 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Dec 2015 10:13:33 +0000 Subject: Fix [c9eb6b0ac01bb8ef96a616c71426a3db4a279bec|c9eb6b0ac0]: ConvertLocalToUTCUsingC fails the first time if TZ is not set --- generic/tclClock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index 3ec94fb..32ba145 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1994,22 +1994,23 @@ ClockSecondsObjCmd( static void TzsetIfNecessary(void) { - static char* tzWas = NULL; /* Previous value of TZ, protected by + static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by * clockMutex. */ const char* tzIsNow; /* Current value of TZ */ Tcl_MutexLock(&clockMutex); tzIsNow = getenv("TZ"); - if (tzIsNow != NULL && (tzWas == NULL || strcmp(tzIsNow, tzWas) != 0)) { + if (tzIsNow != NULL && (tzWas == NULL || tzWas == INT2PTR(-1) + || strcmp(tzIsNow, tzWas) != 0)) { tzset(); - if (tzWas != NULL) { + if (tzWas != NULL && tzWas != INT2PTR(-1)) { ckfree(tzWas); } tzWas = ckalloc(strlen(tzIsNow) + 1); strcpy(tzWas, tzIsNow); } else if (tzIsNow == NULL && tzWas != NULL) { tzset(); - ckfree(tzWas); + if (tzWas != INT2PTR(-1)) ckfree(tzWas); tzWas = NULL; } Tcl_MutexUnlock(&clockMutex); -- cgit v0.12 From f1d71456ca0ed0f306f2fdfbaf3668e506f41aa9 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 12 Dec 2015 11:54:33 +0000 Subject: Issue the correct auxType when compiling [array set]. --- generic/tclCompCmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 18da741..8d0e2f6 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -365,7 +365,7 @@ TclCompileArraySetCmd( infoPtr->varLists[0]->numVars = 2; infoPtr->varLists[0]->varIndexes[0] = keyVar; infoPtr->varLists[0]->varIndexes[1] = valVar; - infoIndex = TclCreateAuxData(infoPtr, &tclForeachInfoType, envPtr); + infoIndex = TclCreateAuxData(infoPtr, &tclNewForeachInfoType, envPtr); /* * Start issuing instructions to write to the array. -- cgit v0.12 From df25840e9998ccae184ac0e650ea1857d1da6634 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Dec 2015 10:33:09 +0000 Subject: Eliminate AuxDataType table: since this table only contains 4 constant entries, it is overkill to use a hash table for that. --- generic/tclCompile.c | 156 ++++----------------------------------------------- generic/tclCompile.h | 2 - generic/tclExecute.c | 2 - 3 files changed, 10 insertions(+), 150 deletions(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index f62ec14..6c4734d 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -17,15 +17,6 @@ #include /* - * Table of all AuxData types. - */ - -static Tcl_HashTable auxDataTypeTable; -static int auxDataTypeTableInitialized; /* 0 means not yet initialized. */ - -TCL_DECLARE_MUTEX(tableMutex) - -/* * Variable that controls whether compilation tracing is enabled and, if so, * what level of tracing is desired: * 0: no compilation tracing @@ -4221,59 +4212,6 @@ TclGetInstructionTable(void) } /* - *-------------------------------------------------------------- - * - * RegisterAuxDataType -- - * - * This procedure is called to register a new AuxData type in the table - * of all AuxData types supported by Tcl. - * - * Results: - * None. - * - * Side effects: - * The type is registered in the AuxData type table. If there was already - * a type with the same name as in typePtr, it is replaced with the new - * type. - * - *-------------------------------------------------------------- - */ - -static void -RegisterAuxDataType( - const AuxDataType *typePtr) /* Information about object type; storage must - * be statically allocated (must live forever; - * will not be deallocated). */ -{ - register Tcl_HashEntry *hPtr; - int isNew; - - Tcl_MutexLock(&tableMutex); - if (!auxDataTypeTableInitialized) { - TclInitAuxDataTypeTable(); - } - - /* - * If there's already a type with the given name, remove it. - */ - - hPtr = Tcl_FindHashEntry(&auxDataTypeTable, typePtr->name); - if (hPtr != NULL) { - Tcl_DeleteHashEntry(hPtr); - } - - /* - * Now insert the new object type. - */ - - hPtr = Tcl_CreateHashEntry(&auxDataTypeTable, typePtr->name, &isNew); - if (isNew) { - Tcl_SetHashValue(hPtr, typePtr); - } - Tcl_MutexUnlock(&tableMutex); -} - -/* *---------------------------------------------------------------------- * * TclGetAuxDataType -- @@ -4294,90 +4232,16 @@ const AuxDataType * TclGetAuxDataType( const char *typeName) /* Name of AuxData type to look up. */ { - register Tcl_HashEntry *hPtr; - const AuxDataType *typePtr = NULL; - - Tcl_MutexLock(&tableMutex); - if (!auxDataTypeTableInitialized) { - TclInitAuxDataTypeTable(); - } - - hPtr = Tcl_FindHashEntry(&auxDataTypeTable, typeName); - if (hPtr != NULL) { - typePtr = Tcl_GetHashValue(hPtr); - } - Tcl_MutexUnlock(&tableMutex); - - return typePtr; -} - -/* - *-------------------------------------------------------------- - * - * TclInitAuxDataTypeTable -- - * - * This procedure is invoked to perform once-only initialization of the - * AuxData type table. It also registers the AuxData types defined in - * this file. - * - * Results: - * None. - * - * Side effects: - * Initializes the table of defined AuxData types "auxDataTypeTable" with - * builtin AuxData types defined in this file. - * - *-------------------------------------------------------------- - */ - -void -TclInitAuxDataTypeTable(void) -{ - /* - * The table mutex must already be held before this routine is invoked. - */ - - auxDataTypeTableInitialized = 1; - Tcl_InitHashTable(&auxDataTypeTable, TCL_STRING_KEYS); - - /* - * There are only four AuxData types at this time, so register them here. - */ - - RegisterAuxDataType(&tclForeachInfoType); - RegisterAuxDataType(&tclNewForeachInfoType); - RegisterAuxDataType(&tclJumptableInfoType); - RegisterAuxDataType(&tclDictUpdateInfoType); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeAuxDataTypeTable -- - * - * This procedure is called by Tcl_Finalize after all exit handlers have - * been run to free up storage associated with the table of AuxData - * types. This procedure is called by TclFinalizeExecution() which is - * called by Tcl_Finalize(). - * - * Results: - * None. - * - * Side effects: - * Deletes all entries in the hash table of AuxData types. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeAuxDataTypeTable(void) -{ - Tcl_MutexLock(&tableMutex); - if (auxDataTypeTableInitialized) { - Tcl_DeleteHashTable(&auxDataTypeTable); - auxDataTypeTableInitialized = 0; - } - Tcl_MutexUnlock(&tableMutex); + if (!strcmp(typeName, tclForeachInfoType.name)) { + return &tclForeachInfoType; + } else if (!strcmp(typeName, tclNewForeachInfoType.name)) { + return &tclNewForeachInfoType; + } else if (!strcmp(typeName, tclDictUpdateInfoType.name)) { + return &tclDictUpdateInfoType; + } else if (!strcmp(typeName, tclJumptableInfoType.name)) { + return &tclJumptableInfoType; + } + return NULL; } /* diff --git a/generic/tclCompile.h b/generic/tclCompile.h index b89346d..8811187 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1123,7 +1123,6 @@ MODULE_SCOPE void TclExpandJumpFixupArray(JumpFixupArray *fixupArrayPtr); MODULE_SCOPE int TclNRExecuteByteCode(Tcl_Interp *interp, ByteCode *codePtr); MODULE_SCOPE Tcl_Obj * TclFetchLiteral(CompileEnv *envPtr, unsigned int index); -MODULE_SCOPE void TclFinalizeAuxDataTypeTable(void); MODULE_SCOPE int TclFindCompiledLocal(const char *name, int nameChars, int create, CompileEnv *envPtr); MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr, @@ -1131,7 +1130,6 @@ MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr, int distThreshold); MODULE_SCOPE void TclFreeCompileEnv(CompileEnv *envPtr); MODULE_SCOPE void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr); -MODULE_SCOPE void TclInitAuxDataTypeTable(void); MODULE_SCOPE void TclInitByteCodeObj(Tcl_Obj *objPtr, CompileEnv *envPtr); MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp, diff --git a/generic/tclExecute.c b/generic/tclExecute.c index b10af65..dacc9e2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -927,7 +927,6 @@ TclCreateExecEnv( Tcl_MutexLock(&execMutex); if (!execInitialized) { - TclInitAuxDataTypeTable(); InitByteCodeExecution(interp); execInitialized = 1; } @@ -1026,7 +1025,6 @@ TclFinalizeExecution(void) Tcl_MutexLock(&execMutex); execInitialized = 0; Tcl_MutexUnlock(&execMutex); - TclFinalizeAuxDataTypeTable(); } /* -- cgit v0.12 From 62b1f5c63defe1dc95bf58b163ef0aa0fd1fa699 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Dec 2015 11:13:32 +0000 Subject: make some MODULE_SCOPE symbols static --- generic/tclCompCmds.c | 45 +++++++++++++++++++++++++++++++++++++++------ generic/tclCompile.c | 33 --------------------------------- generic/tclCompile.h | 11 ----------- 3 files changed, 39 insertions(+), 50 deletions(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 8d0e2f6..3ab03cc 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -54,7 +54,7 @@ static int CompileDictEachCmd(Tcl_Interp *interp, * The structures below define the AuxData types defined in this file. */ -const AuxDataType tclForeachInfoType = { +static const AuxDataType foreachInfoType = { "ForeachInfo", /* name */ DupForeachInfo, /* dupProc */ FreeForeachInfo, /* freeProc */ @@ -62,7 +62,7 @@ const AuxDataType tclForeachInfoType = { DisassembleForeachInfo /* disassembleProc */ }; -const AuxDataType tclNewForeachInfoType = { +static const AuxDataType newForeachInfoType = { "NewForeachInfo", /* name */ DupForeachInfo, /* dupProc */ FreeForeachInfo, /* freeProc */ @@ -70,7 +70,7 @@ const AuxDataType tclNewForeachInfoType = { DisassembleNewForeachInfo /* disassembleProc */ }; -const AuxDataType tclDictUpdateInfoType = { +static const AuxDataType dictUpdateInfoType = { "DictUpdateInfo", /* name */ DupDictUpdateInfo, /* dupProc */ FreeDictUpdateInfo, /* freeProc */ @@ -81,6 +81,39 @@ const AuxDataType tclDictUpdateInfoType = { /* *---------------------------------------------------------------------- * + * TclGetAuxDataType -- + * + * This procedure looks up an Auxdata type by name. + * + * Results: + * If an AuxData type with name matching "typeName" is found, a pointer + * to its AuxDataType structure is returned; otherwise, NULL is returned. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +const AuxDataType * +TclGetAuxDataType( + const char *typeName) /* Name of AuxData type to look up. */ +{ + if (!strcmp(typeName, foreachInfoType.name)) { + return &foreachInfoType; + } else if (!strcmp(typeName, newForeachInfoType.name)) { + return &newForeachInfoType; + } else if (!strcmp(typeName, dictUpdateInfoType.name)) { + return &dictUpdateInfoType; + } else if (!strcmp(typeName, tclJumptableInfoType.name)) { + return &tclJumptableInfoType; + } + return NULL; +} + +/* + *---------------------------------------------------------------------- + * * TclCompileAppendCmd -- * * Procedure called to compile the "append" command. @@ -365,7 +398,7 @@ TclCompileArraySetCmd( infoPtr->varLists[0]->numVars = 2; infoPtr->varLists[0]->varIndexes[0] = keyVar; infoPtr->varLists[0]->varIndexes[1] = valVar; - infoIndex = TclCreateAuxData(infoPtr, &tclNewForeachInfoType, envPtr); + infoIndex = TclCreateAuxData(infoPtr, &newForeachInfoType, envPtr); /* * Start issuing instructions to write to the array. @@ -1669,7 +1702,7 @@ TclCompileDictUpdateCmd( * can't be snagged by literal sharing and forced to shimmer dangerously. */ - infoIndex = TclCreateAuxData(duiPtr, &tclDictUpdateInfoType, envPtr); + infoIndex = TclCreateAuxData(duiPtr, &dictUpdateInfoType, envPtr); for (i=0 ; iauxDataArrayPtr[TclGetUInt4AtPtr(index)].clientData)) - /* * Structure used to hold information about a switch command that is needed * during program execution. These structures are stored in CompileEnv and @@ -1033,11 +1027,6 @@ typedef struct { * STRUCTURE. */ } DictUpdateInfo; -MODULE_SCOPE const AuxDataType tclDictUpdateInfoType; - -#define DICTUPDATEINFO(envPtr, index) \ - ((DictUpdateInfo*)((envPtr)->auxDataArrayPtr[TclGetUInt4AtPtr(index)].clientData)) - /* * ClientData type used by the math operator commands. */ -- cgit v0.12 From b8ee717f77fc6f8add7137b14be34357192aacea Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Dec 2015 13:19:43 +0000 Subject: Remove unused static function definition --- generic/tclCompile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 6598829..4c259ab 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -679,7 +679,6 @@ static int IsCompactibleCompileEnv(Tcl_Interp *interp, #ifdef TCL_COMPILE_STATS static void RecordByteCodeStats(ByteCode *codePtr); #endif /* TCL_COMPILE_STATS */ -static void RegisterAuxDataType(const AuxDataType *typePtr); static int SetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void StartExpanding(CompileEnv *envPtr); -- cgit v0.12 From 9766a76000f4b621c0fa1ef9f7ad6d41d0f36a74 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 21 Dec 2015 10:27:19 +0000 Subject: Code-cleanup: CONST -> const, don't use macro's like __REG_CONST and types like re_void any more. No change in functionality. --- generic/regcustom.h | 8 ------- generic/regex.h | 60 ++++++++++++++--------------------------------------- unix/Makefile.in | 2 +- win/tclWinChan.c | 2 +- 4 files changed, 18 insertions(+), 54 deletions(-) diff --git a/generic/regcustom.h b/generic/regcustom.h index 1c970ea..681b97d 100644 --- a/generic/regcustom.h +++ b/generic/regcustom.h @@ -60,12 +60,6 @@ #ifdef __REG_REGOFF_T #undef __REG_REGOFF_T #endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif #ifdef __REG_NOFRONT #undef __REG_NOFRONT #endif @@ -75,8 +69,6 @@ /* Interface types */ #define __REG_WIDE_T Tcl_UniChar #define __REG_REGOFF_T long /* Not really right, but good enough... */ -#define __REG_VOID_T void -#define __REG_CONST const /* Names and declarations */ #define __REG_WIDE_COMPILE TclReComp #define __REG_WIDE_EXEC TclReExec diff --git a/generic/regex.h b/generic/regex.h index 53450e5..8845f72 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -92,12 +92,6 @@ extern "C" { #ifdef __REG_REGOFF_T #undef __REG_REGOFF_T #endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif #ifdef __REG_NOFRONT #undef __REG_NOFRONT #endif @@ -107,8 +101,6 @@ extern "C" { /* interface types */ #define __REG_WIDE_T Tcl_UniChar #define __REG_REGOFF_T long /* not really right, but good enough... */ -#define __REG_VOID_T void -#define __REG_CONST const /* names and declarations */ #define __REG_WIDE_COMPILE TclReComp #define __REG_WIDE_EXEC TclReExec @@ -134,26 +126,6 @@ typedef long regoff_t; #endif /* - * For benefit of old compilers, we offer the option of - * overriding the `void' type used to declare nonexistent return types. - */ -#ifdef __REG_VOID_T -typedef __REG_VOID_T re_void; -#else -typedef void re_void; -#endif - -/* - * Also for benefit of old compilers, can supply a macro which - * expands to a substitute for `const'. - */ -#ifndef __REG_CONST -#define __REG_CONST const -#endif - - - -/* * other interface types */ @@ -197,13 +169,13 @@ typedef struct { /* * compilation ^ #ifndef __REG_NOCHAR - ^ int re_comp(regex_t *, __REG_CONST char *, size_t, int); + ^ int re_comp(regex_t *, const char *, size_t, int); ^ #endif ^ #ifndef __REG_NOFRONT - ^ int regcomp(regex_t *, __REG_CONST char *, int); + ^ int regcomp(regex_t *, const char *, int); ^ #endif ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); + ^ int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int); ^ #endif */ #define REG_BASIC 000000 /* BREs (convenience) */ @@ -228,14 +200,14 @@ typedef struct { /* * execution ^ #ifndef __REG_NOCHAR - ^ int re_exec(regex_t *, __REG_CONST char *, size_t, + ^ int re_exec(regex_t *, const char *, size_t, ^ rm_detail_t *, size_t, regmatch_t [], int); ^ #endif ^ #ifndef __REG_NOFRONT - ^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); + ^ int regexec(regex_t *, const char *, size_t, regmatch_t [], int); ^ #endif ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, + ^ int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, ^ rm_detail_t *, size_t, regmatch_t [], int); ^ #endif */ @@ -248,7 +220,7 @@ typedef struct { /* * misc generics (may be more functions here eventually) - ^ re_void regfree(regex_t *); + ^ void regfree(regex_t *); */ /* @@ -260,7 +232,7 @@ typedef struct { * of character is used for error reports is independent of what kind is used * in matching. * - ^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t); + ^ extern size_t regerror(int, const regex_t *, char *, size_t); */ #define REG_OKAY 0 /* no errors detected */ #define REG_NOMATCH 1 /* failed to match */ @@ -293,25 +265,25 @@ typedef struct { /* automatically gathered by fwd; do not hand-edit */ /* === regproto.h === */ #ifndef __REG_NOCHAR -int re_comp(regex_t *, __REG_CONST char *, size_t, int); +int re_comp(regex_t *, const char *, size_t, int); #endif #ifndef __REG_NOFRONT -int regcomp(regex_t *, __REG_CONST char *, int); +int regcomp(regex_t *, const char *, int); #endif #ifdef __REG_WIDE_T -MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); +MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int); #endif #ifndef __REG_NOCHAR -int re_exec(regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int); +int re_exec(regex_t *, const char *, size_t, rm_detail_t *, size_t, regmatch_t [], int); #endif #ifndef __REG_NOFRONT -int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); +int regexec(regex_t *, const char *, size_t, regmatch_t [], int); #endif #ifdef __REG_WIDE_T -MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int); +MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int); #endif -MODULE_SCOPE re_void regfree(regex_t *); -MODULE_SCOPE size_t regerror(int, __REG_CONST regex_t *, char *, size_t); +MODULE_SCOPE void regfree(regex_t *); +MODULE_SCOPE size_t regerror(int, const regex_t *, char *, size_t); /* automatically gathered by fwd; do not hand-edit */ /* =====^!^===== end forwards =====^!^===== */ diff --git a/unix/Makefile.in b/unix/Makefile.in index da43c5d..bc73118 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1828,7 +1828,7 @@ gendate: # -e 's?SCCSID?RCS: @(#) ?' \ # -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \ # -e '/TclDatenewstate:/d' -e '/#pragma/d' \ -# -e '/#include /d' -e 's/const /CONST /g' \ +# -e '/#include /d' \ # -e '/#define YYNEW/s/malloc/TclDateAlloc/g' \ # -e '/#define YYENLARGE/,/realloc/s/realloc/TclDateRealloc/g' \ # $(GENERIC_DIR)/tclDate.c diff --git a/win/tclWinChan.c b/win/tclWinChan.c index cca0dab..78b510b 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -95,7 +95,7 @@ static void FileThreadActionProc(ClientData instanceData, static int FileTruncateProc(ClientData instanceData, Tcl_WideInt length); static DWORD FileGetType(HANDLE handle); -static int NativeIsComPort(CONST TCHAR *nativeName); +static int NativeIsComPort(const TCHAR *nativeName); /* * This structure describes the channel type structure for file based IO. */ -- cgit v0.12 From 1614457e38312b8180cd9ef843bffcc6a45a14cc Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 22 Dec 2015 18:27:23 +0000 Subject: [593baa032c] Possible fix (with test) for segfault in superclass teardown. --- generic/tclOO.c | 29 ++++++++++++++++++++--------- tests/oo.test | 7 +++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 5fca220..f2e0ca9 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -58,6 +58,7 @@ static const struct { static Class * AllocClass(Tcl_Interp *interp, Object *useThisObj); static Object * AllocObject(Tcl_Interp *interp, const char *nameStr, const char *nsNameStr); +static void ClearSuperclasses(Class *clsPtr); static int CloneClassMethod(Tcl_Interp *interp, Class *clsPtr, Method *mPtr, Tcl_Obj *namePtr, Method **newMPtrPtr); @@ -905,6 +906,20 @@ ObjectRenamedTrace( */ static void +ClearSuperclasses( + Class *clsPtr) +{ + int i; + Class *superPtr; + + FOREACH(superPtr, clsPtr->superclasses) { + TclOORemoveFromSubclasses(clsPtr, superPtr); + } + ckfree(clsPtr->superclasses.list); + clsPtr->superclasses.num = 0; +} + +static void ReleaseClassContents( Tcl_Interp *interp, /* The interpreter containing the class. */ Object *oPtr) /* The object representing the class. */ @@ -999,6 +1014,9 @@ ReleaseClassContents( if (!Deleted(subclassPtr->thisPtr)) { Tcl_DeleteCommandFromToken(interp, subclassPtr->thisPtr->command); } + if (subclassPtr->superclasses.num) { + ClearSuperclasses(subclassPtr); + } DelRef(subclassPtr->thisPtr); DelRef(subclassPtr); } @@ -1195,7 +1213,6 @@ ObjectNamespaceDeleted( } if (clsPtr != NULL) { - Class *superPtr; Tcl_ObjectMetadataType *metadataTypePtr; ClientData value; @@ -1224,14 +1241,8 @@ ObjectNamespaceDeleted( ckfree(clsPtr->mixins.list); clsPtr->mixins.num = 0; } - FOREACH(superPtr, clsPtr->superclasses) { - if (!Deleted(superPtr->thisPtr)) { - TclOORemoveFromSubclasses(clsPtr, superPtr); - } - } - if (i) { - ckfree(clsPtr->superclasses.list); - clsPtr->superclasses.num = 0; + if (clsPtr->superclasses.num) { + ClearSuperclasses(clsPtr); } if (clsPtr->subclasses.list) { ckfree(clsPtr->subclasses.list); diff --git a/tests/oo.test b/tests/oo.test index 2112f10..ca5c7f9 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -3671,6 +3671,13 @@ test oo-35.2 {Bug 9d61624b3d: Empty superclass must not cause crash} -setup { unset -nocomplain result fruitMetaclass destroy } -result {::appleClass ::orange ::oo::class ::oo::class 1 1 ::appleClass ::pear} +test oo-35.3 {Bug 593baa032c: superclass list teardown} { + # Bug makes this crash, especially with mem-debugging on + oo::class create B {} + oo::class create D {superclass B} + namespace eval [info object namespace D] [list [namespace which B] destroy] +} {} + cleanupTests return -- cgit v0.12 From 2516cd875a00dd9b9f1d23f43a86342c1007bdb4 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 22 Dec 2015 19:50:04 +0000 Subject: [593baa032c] Additional fix for the mixinSubs list. --- generic/tclOO.c | 29 +++++++++++++++++++++-------- tests/oo.test | 6 ++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index f2e0ca9..34eb5ad 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -58,6 +58,7 @@ static const struct { static Class * AllocClass(Tcl_Interp *interp, Object *useThisObj); static Object * AllocObject(Tcl_Interp *interp, const char *nameStr, const char *nsNameStr); +static void ClearMixins(Class *clsPtr); static void ClearSuperclasses(Class *clsPtr); static int CloneClassMethod(Tcl_Interp *interp, Class *clsPtr, Method *mPtr, Tcl_Obj *namePtr, @@ -906,6 +907,20 @@ ObjectRenamedTrace( */ static void +ClearMixins( + Class *clsPtr) +{ + int i; + Class *mixinPtr; + + FOREACH(mixinPtr, clsPtr->mixins) { + TclOORemoveFromMixinSubs(clsPtr, mixinPtr); + } + ckfree(clsPtr->mixins.list); + clsPtr->mixins.num = 0; +} + +static void ClearSuperclasses( Class *clsPtr) { @@ -994,6 +1009,9 @@ ReleaseClassContents( Tcl_DeleteCommandFromToken(interp, mixinSubclassPtr->thisPtr->command); } + if (mixinSubclassPtr->mixins.num) { + ClearMixins(mixinSubclassPtr); + } DelRef(mixinSubclassPtr->thisPtr); DelRef(mixinSubclassPtr); } @@ -1232,14 +1250,9 @@ ObjectNamespaceDeleted( ckfree(clsPtr->filters.list); clsPtr->filters.num = 0; } - FOREACH(mixinPtr, clsPtr->mixins) { - if (!Deleted(mixinPtr->thisPtr)) { - TclOORemoveFromMixinSubs(clsPtr, mixinPtr); - } - } - if (i) { - ckfree(clsPtr->mixins.list); - clsPtr->mixins.num = 0; + + if (clsPtr->mixins.num) { + ClearMixins(clsPtr); } if (clsPtr->superclasses.num) { ClearSuperclasses(clsPtr); diff --git a/tests/oo.test b/tests/oo.test index ca5c7f9..895f7ed 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -3677,6 +3677,12 @@ test oo-35.3 {Bug 593baa032c: superclass list teardown} { oo::class create D {superclass B} namespace eval [info object namespace D] [list [namespace which B] destroy] } {} +test oo-35.4 {Bug 593baa032c: mixins list teardown} { + # Bug makes this crash, especially with mem-debugging on + oo::class create B {} + oo::class create D {mixin B} + namespace eval [info object namespace D] [list [namespace which B] destroy] +} {} cleanupTests -- cgit v0.12 From 97e52f918d3e35ec3f61e099424ccf966aae3101 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 1 Jan 2016 17:46:45 +0000 Subject: Document the Tcl_CancelEval function correctly. It was missing its second argument, making using it correctly impossible, especially from C++. --- doc/Cancel.3 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/Cancel.3 b/doc/Cancel.3 index 5d258b7..f6b1636 100644 --- a/doc/Cancel.3 +++ b/doc/Cancel.3 @@ -13,20 +13,25 @@ Tcl_CancelEval, Tcl_Canceled \- cancel Tcl scripts .nf \fB#include \fR int -\fBTcl_CancelEval\fR(\fIinterp, clientData, flags\fR) +\fBTcl_CancelEval\fR(\fIinterp, resultObjPtr, clientData, flags\fR) .sp int \fBTcl_Canceled\fR(\fIinterp, flags\fR) .SH ARGUMENTS +.AS Tcl_Interp *interp .AP Tcl_Interp *interp in Interpreter in which to cancel the script. +.AP Tcl_Obj *resultObjPtr in +Error message to use in the cancellation, or NULL to use a default message. If +not NULL, this object will have its reference count decremented before +\fBTcl_CancelEval\fR returns. .AP int flags in ORed combination of flag bits that specify additional options. For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and \fBTCL_CANCEL_UNWIND\fR are currently supported. .AP ClientData clientData in -Currently, reserved for future use. +Currently reserved for future use. It should be set to NULL. .BE .SH DESCRIPTION @@ -41,19 +46,21 @@ returns \fBTCL_ERROR\fR if it has. Otherwise, \fBTCL_OK\fR is returned. Extensions can use this function to check to see if they should abort a long running command. This function is thread sensitive and may only be called from the thread the interpreter was created in. -.SH "FLAG BITS" +.SS "FLAG BITS" Any ORed combination of the following values may be used for the \fIflags\fR argument to procedures such as \fBTcl_CancelEval\fR: -.TP 23 +.TP 20 \fBTCL_CANCEL_UNWIND\fR +. This flag is used by \fBTcl_CancelEval\fR and \fBTcl_Canceled\fR. For \fBTcl_CancelEval\fR, if this flag is set, the script in progress is canceled and the evaluation stack for the interpreter is unwound. For \fBTcl_Canceled\fR, if this flag is set, the script in progress is considered to be canceled only if the evaluation stack for the interpreter is being unwound. -.TP 23 +.TP 20 \fBTCL_LEAVE_ERR_MSG\fR +. This flag is only used by \fBTcl_Canceled\fR; it is ignored by other procedures. If an error is returned and this bit is set in \fIflags\fR, then an error message will be left in the interpreter's @@ -61,6 +68,7 @@ result, where it can be retrieved with \fBTcl_GetObjResult\fR or \fBTcl_GetStringResult\fR. If this flag bit is not set then no error message is left and the interpreter's result will not be modified. .SH "SEE ALSO" +interp(n), Tcl_Eval(3), TIP 285 .SH KEYWORDS cancel, unwind -- cgit v0.12 From 86b9cc18cdb1b06c9e34a429885a716f2c3e6a04 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Jan 2016 11:15:20 +0000 Subject: Fix win32 mingw 32-bit build, bug was introduced by [c397433be321e6d9] (wrong zlib1.dll was copied) --- win/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/Makefile.in b/win/Makefile.in index 7e6486c..2d27a41 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -468,7 +468,7 @@ ${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} # use pre-built zlib1.dll ${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE} - @if test "@ZLIB_LIBS@set" != "${ZLIB_DIR}/win32/zdll.libset" ; then \ + @if test "@ZLIB_LIBS@set" != "${ZLIB_DIR_NATIVE}/win32/zdll.libset" ; then \ $(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ else \ $(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ -- cgit v0.12 From 7b79011075ebaea03aecd04ccb351f56681469a4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 Jan 2016 11:33:02 +0000 Subject: Fix [f01d74dc8c]: DEFAULT_COPY_BLOCK_SIZE has incorrect value --- unix/tclUnixFCmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 3b1b6ca..a1a409e 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -564,7 +564,7 @@ TclUnixCopyFile( #define BINMODE #endif /* DJGPP */ -#define DEFAULT_COPY_BLOCK_SIZE 4069 +#define DEFAULT_COPY_BLOCK_SIZE 4096 if ((srcFd = TclOSopen(src, O_RDONLY BINMODE, 0)) < 0) { /* INTL: Native */ return TCL_ERROR; -- cgit v0.12 From 247529b2e2220a8d411a33788f9e7be3828d12a6 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Thu, 14 Jan 2016 23:55:45 +0000 Subject: Add the tcl_platform(engine) element, TIP to be written. --- generic/tclBasic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 5c5bc64..0bb43cc 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -916,6 +916,13 @@ Tcl_CreateInterp(void) TclInitEmbeddedConfigurationInformation(interp); /* + * TIP #XXX: Declare the name of the script engine to be "Tcl". + */ + + Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl", + TCL_GLOBAL_ONLY); + + /* * Compute the byte order of this machine. */ -- cgit v0.12 From 4320d2b7859b143036f361013d5eaa7d0baaa5c8 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Fri, 15 Jan 2016 00:39:41 +0000 Subject: Add docs and tests. --- doc/tclvars.n | 5 +++++ tests/platform.test | 6 +++++- tests/safe.test | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/tclvars.n b/doc/tclvars.n index a8fba47..a256c21 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -299,6 +299,11 @@ so extension writers can specify which package to load depending on the C run-time library that is in use. This is not an indication that this core contains symbols. .TP +\fBengine\fR +. +The name of the Tcl language implementation. When the interpreter is first +created, this is always set to the string \fBTcl\fR. +.TP \fBmachine\fR . The instruction set executed by this machine, such as diff --git a/tests/platform.test b/tests/platform.test index cc00d49..c826444 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -23,6 +23,10 @@ catch [list package require -exact Tcltest [info patchlevel]] testConstraint testCPUID [llength [info commands testcpuid]] +test platform-1.0 {tcl_platform(engine)} { + set tcl_platform(engine) +} {Tcl} + test platform-1.1 {TclpSetVariables: tcl_platform} { interp create i i eval {catch {unset tcl_platform(debug)}} @@ -30,7 +34,7 @@ test platform-1.1 {TclpSetVariables: tcl_platform} { set result [i eval {lsort [array names tcl_platform]}] interp delete i set result -} {byteOrder machine os osVersion pathSeparator platform pointerSize user wordSize} +} {byteOrder engine machine os osVersion pathSeparator platform pointerSize user wordSize} # Test assumes twos-complement arithmetic, which is true of virtually # everything these days. Note that this does *not* use wide(), and diff --git a/tests/safe.test b/tests/safe.test index 859f352..94c1755 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -174,7 +174,7 @@ test safe-6.3 {test safe interpreters knowledge of the world} { } set r [lsearch -all -inline -not -exact $r "threaded"] lsort $r -} {byteOrder pathSeparator platform pointerSize wordSize} +} {byteOrder engine pathSeparator platform pointerSize wordSize} # More test should be added to check that hostname, nameofexecutable, aren't # leaking infos, but they still do... -- cgit v0.12 From 7a410220dde1167eb71e19d5e53ce442fbe27cd6 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 18 Jan 2016 10:16:35 +0000 Subject: Put the file location information that Tcl has into the disassembled code. Important for tclquadcode. --- generic/tclDisassemble.c | 99 +++++++++++++++++++++++++++++++++++++++++++----- generic/tclInt.h | 3 +- tests/compile.test | 42 ++++++++++++++++++-- 3 files changed, 131 insertions(+), 13 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 86f0e1d..a60a58d 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -21,9 +21,13 @@ * Prototypes for procedures defined later in this file: */ -static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Obj *objPtr); +static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp, + Tcl_Obj *objPtr); static int FormatInstruction(ByteCode *codePtr, const unsigned char *pc, Tcl_Obj *bufferObj); +static void GetLocationInformation(Tcl_Interp *interp, + Proc *procPtr, Tcl_Obj **fileObjPtr, + int *linePtr); static void PrintSourceToObj(Tcl_Obj *appendObj, const char *stringPtr, int maxChars); static void UpdateStringOfInstName(Tcl_Obj *objPtr); @@ -48,6 +52,57 @@ static const Tcl_ObjType tclInstNameType = { #define BYTECODE(objPtr) \ ((ByteCode *) (objPtr)->internalRep.twoPtrValue.ptr1) +/* + *---------------------------------------------------------------------- + * + * GetLocationInformation -- + * + * This procedure looks up the information about where a procedure was + * originally declared. + * + * Results: + * Writes to the variables pointed at by fileObjPtr and linePtr. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +GetLocationInformation( + Tcl_Interp *interp, /* Where to look up the location + * information. */ + Proc *procPtr, /* What to look up the information for. */ + Tcl_Obj **fileObjPtr, /* Where to write the information about what + * file the code came from. Will be written + * to, either with the object (assume shared!) + * that describes what the file was, or with + * NULL if the information is not + * available. */ + int *linePtr) /* Where to write the information about what + * line number represented the start of the + * code in question. Will be written to, + * either with the line number or with -1 if + * the information is not available. */ +{ + Interp *iPtr = (Interp *) interp; + Tcl_HashEntry *hePtr; + CmdFrame *cfPtr; + + *fileObjPtr = NULL; + *linePtr = -1; + if (iPtr != NULL && procPtr != NULL) { + hePtr = Tcl_FindHashEntry(iPtr->linePBodyPtr, procPtr); + if (hePtr != NULL && (cfPtr = Tcl_GetHashValue(hePtr)) != NULL) { + *linePtr = cfPtr->line[0]; + if (cfPtr->type == TCL_LOCATION_SOURCE) { + *fileObjPtr = cfPtr->data.eval.path; + } + } + } +} + #ifdef TCL_COMPILE_DEBUG /* *---------------------------------------------------------------------- @@ -68,10 +123,10 @@ static const Tcl_ObjType tclInstNameType = { void TclPrintByteCodeObj( - Tcl_Interp *interp, /* Used only for Tcl_GetStringFromObj. */ + Tcl_Interp *interp, /* Used only for getting location info. */ Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { - Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(objPtr); + Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(interp, objPtr); fprintf(stdout, "\n%s", TclGetString(bufPtr)); Tcl_DecrRefCount(bufPtr); @@ -187,15 +242,16 @@ TclPrintSource( Tcl_Obj * TclDisassembleByteCodeObj( + Tcl_Interp *interp, Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { ByteCode *codePtr = BYTECODE(objPtr); unsigned char *codeStart, *codeLimit, *pc; unsigned char *codeDeltaNext, *codeLengthNext; unsigned char *srcDeltaNext, *srcLengthNext; - int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i; + int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i, line; Interp *iPtr = (Interp *) *codePtr->interpHandle; - Tcl_Obj *bufferObj; + Tcl_Obj *bufferObj, *fileObj; char ptrBuf1[20], ptrBuf2[20]; TclNewObj(bufferObj); @@ -220,6 +276,11 @@ TclDisassembleByteCodeObj( Tcl_AppendToObj(bufferObj, " Source ", -1); PrintSourceToObj(bufferObj, codePtr->source, TclMin(codePtr->numSrcBytes, 55)); + GetLocationInformation(interp, codePtr->procPtr, &fileObj, &line); + if (line > -1 && fileObj != NULL) { + Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d", + Tcl_GetString(fileObj), line); + } Tcl_AppendPrintfToObj(bufferObj, "\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes, @@ -881,14 +942,16 @@ PrintSourceToObj( static Tcl_Obj * DisassembleByteCodeAsDicts( + Tcl_Interp *interp, /* Used for looking up the CmdFrame for the + * procedure, if one exists. */ Tcl_Obj *objPtr) /* The bytecode-holding value to take apart */ { ByteCode *codePtr = BYTECODE(objPtr); Tcl_Obj *description, *literals, *variables, *instructions, *inst; - Tcl_Obj *aux, *exn, *commands; + Tcl_Obj *aux, *exn, *commands, *file; unsigned char *pc, *opnd, *codeOffPtr, *codeLenPtr, *srcOffPtr, *srcLenPtr; int codeOffset, codeLength, sourceOffset, sourceLength; - int i, val; + int i, val, line; /* * Get the literals from the bytecode. @@ -1152,6 +1215,13 @@ DisassembleByteCodeAsDicts( #undef Decode /* + * Get the source file and line number information from the CmdFrame + * system if it is available. + */ + + GetLocationInformation(interp, codePtr->procPtr, &file, &line); + + /* * Build the overall result. */ @@ -1174,6 +1244,15 @@ DisassembleByteCodeAsDicts( Tcl_NewIntObj(codePtr->maxStackDepth)); Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exceptdepth", -1), Tcl_NewIntObj(codePtr->maxExceptDepth)); + if (line > -1) { + Tcl_DictObjPut(NULL, description, + Tcl_NewStringObj("initiallinenumber", -1), + Tcl_NewIntObj(line)); + } + if (file) { + Tcl_DictObjPut(NULL, description, + Tcl_NewStringObj("sourcefile", -1), file); + } return description; } @@ -1403,9 +1482,11 @@ Tcl_DisassembleObjCmd( return TCL_ERROR; } if (PTR2INT(clientData)) { - Tcl_SetObjResult(interp, DisassembleByteCodeAsDicts(codeObjPtr)); + Tcl_SetObjResult(interp, + DisassembleByteCodeAsDicts(interp, codeObjPtr)); } else { - Tcl_SetObjResult(interp, TclDisassembleByteCodeObj(codeObjPtr)); + Tcl_SetObjResult(interp, + TclDisassembleByteCodeObj(interp, codeObjPtr)); } return TCL_OK; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 082fab4..9a5b4bf 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3152,7 +3152,8 @@ MODULE_SCOPE void TclFinalizeThreadStorage(void); MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); #endif -MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Obj *objPtr); +MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Interp *interp, + Tcl_Obj *objPtr); MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp); MODULE_SCOPE void * TclpThreadCreateKey(void); MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr); diff --git a/tests/compile.test b/tests/compile.test index d4a31d4..46e678a 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -765,7 +765,7 @@ test compile-18.24 {disassembler - basics} -returnCodes error -body { } -result "can't interpret \"\{\" as a lambda expression" test compile-18.25 {disassembler - basics} -body { dict keys [tcl::unsupported::getbytecode lambda {{} {}}] -} -result $bytecodekeys +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-18.26 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode proc } -match glob -result {wrong # args: should be "* proc procName"} @@ -778,7 +778,43 @@ test compile-18.28 {disassembler - basics} -setup { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename chewonthis {} +} -result "$bytecodekeys initiallinenumber sourcefile" +test compile-18.28.1 {disassembler - tricky bit} -setup { + eval [list proc chewonthis {} {}] +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename chewonthis {} +} -result $bytecodekeys +test compile-18.28.2 {disassembler - tricky bit} -setup { + eval {proc chewonthis {} {}} +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename chewonthis {} +} -result "$bytecodekeys initiallinenumber sourcefile" +test compile-18.28.3 {disassembler - tricky bit} -setup { + proc Proc {n a b} { + proc $n $a $b + } + Proc chewonthis {} {} +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename Proc {} + rename chewonthis {} } -result $bytecodekeys +test compile-18.28.4 {disassembler - tricky bit} -setup { + proc Proc {n a b} { + tailcall proc $n $a $b + } + Proc chewonthis {} {} +} -body { + dict keys [tcl::unsupported::getbytecode proc chewonthis] +} -cleanup { + rename Proc {} + rename chewonthis {} +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-18.29 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode script } -match glob -result {wrong # args: should be "* script script"} @@ -807,7 +843,7 @@ test compile-18.35 {disassembler - basics} -setup { dict keys [tcl::unsupported::getbytecode method foo bar] } -cleanup { foo destroy -} -result $bytecodekeys +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-18.36 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode objmethod } -match glob -result {wrong # args: should be "* objmethod objectName methodName"} @@ -824,7 +860,7 @@ test compile-18.39 {disassembler - basics} -setup { dict keys [tcl::unsupported::getbytecode objmethod foo bar] } -cleanup { foo destroy -} -result $bytecodekeys +} -result "$bytecodekeys initiallinenumber sourcefile" test compile-19.0 {Bug 3614102: reset stack housekeeping} -body { # This will panic in a --enable-symbols=compile build, unless bug is fixed. -- cgit v0.12 From a03db6ab78e482f5bd0a3acbf350f81361ae4da4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Jan 2016 12:19:31 +0000 Subject: Make function TclDisassembleByteCodeObj() static, since it is only used in a single source file. --- generic/tclDisassemble.c | 14 ++++++++------ generic/tclInt.h | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index a60a58d..c85fe13 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -23,6 +23,8 @@ static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp, Tcl_Obj *objPtr); +static Tcl_Obj * DisassembleByteCodeObj(Tcl_Interp *interp, + Tcl_Obj *objPtr); static int FormatInstruction(ByteCode *codePtr, const unsigned char *pc, Tcl_Obj *bufferObj); static void GetLocationInformation(Tcl_Interp *interp, @@ -126,7 +128,7 @@ TclPrintByteCodeObj( Tcl_Interp *interp, /* Used only for getting location info. */ Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { - Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(interp, objPtr); + Tcl_Obj *bufPtr = DisassembleByteCodeObj(interp, objPtr); fprintf(stdout, "\n%s", TclGetString(bufPtr)); Tcl_DecrRefCount(bufPtr); @@ -231,7 +233,7 @@ TclPrintSource( /* *---------------------------------------------------------------------- * - * TclDisassembleByteCodeObj -- + * DisassembleByteCodeObj -- * * Given an object which is of bytecode type, return a disassembled * version of the bytecode (in a new refcount 0 object). No guarantees @@ -240,8 +242,8 @@ TclPrintSource( *---------------------------------------------------------------------- */ -Tcl_Obj * -TclDisassembleByteCodeObj( +static Tcl_Obj * +DisassembleByteCodeObj( Tcl_Interp *interp, Tcl_Obj *objPtr) /* The bytecode object to disassemble. */ { @@ -368,7 +370,7 @@ TclDisassembleByteCodeObj( rangePtr->catchOffset); break; default: - Tcl_Panic("TclDisassembleByteCodeObj: bad ExceptionRange type %d", + Tcl_Panic("DisassembleByteCodeObj: bad ExceptionRange type %d", rangePtr->type); } } @@ -1486,7 +1488,7 @@ Tcl_DisassembleObjCmd( DisassembleByteCodeAsDicts(interp, codeObjPtr)); } else { Tcl_SetObjResult(interp, - TclDisassembleByteCodeObj(interp, codeObjPtr)); + DisassembleByteCodeObj(interp, codeObjPtr)); } return TCL_OK; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 9a5b4bf..42c13dd 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3152,8 +3152,6 @@ MODULE_SCOPE void TclFinalizeThreadStorage(void); MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); #endif -MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Interp *interp, - Tcl_Obj *objPtr); MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp); MODULE_SCOPE void * TclpThreadCreateKey(void); MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr); -- cgit v0.12 From d35ea153489e5abcf15a7e2de5a2659e72c2373b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Jan 2016 14:32:41 +0000 Subject: Eliminate some usages of Tcl_GlobalEval() and Tcl_Eval(), which are deprecated functions. --- generic/tclTest.c | 12 ++++++------ generic/tclTestProcBodyObj.c | 2 +- generic/tclThreadTest.c | 6 +++--- generic/tclTrace.c | 3 ++- generic/tclZlib.c | 4 ++-- unix/dltest/pkge.c | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 600f5ec..284d80a 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -958,7 +958,7 @@ AsyncHandlerProc( listArgv[3] = NULL; cmd = Tcl_Merge(3, listArgv); if (interp != NULL) { - code = Tcl_Eval(interp, cmd); + code = Tcl_EvalEx(interp, cmd, -1, 0); } else { /* * this should not happen, but by definition of how async handlers are @@ -1241,7 +1241,7 @@ TestcmdtraceCmd( if (strcmp(argv[1], "tracetest") == 0) { Tcl_DStringInit(&buffer); cmdTrace = Tcl_CreateTrace(interp, 50000, CmdTraceProc, &buffer); - result = Tcl_Eval(interp, argv[2]); + result = Tcl_EvalEx(interp, argv[2], -1, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); @@ -1257,13 +1257,13 @@ TestcmdtraceCmd( */ cmdTrace = Tcl_CreateTrace(interp, 50000, CmdTraceDeleteProc, NULL); - Tcl_Eval(interp, argv[2]); + Tcl_EvalEx(interp, argv[2], -1, 0); } else if (strcmp(argv[1], "leveltest") == 0) { Interp *iPtr = (Interp *) interp; Tcl_DStringInit(&buffer); cmdTrace = Tcl_CreateTrace(interp, iPtr->numLevels + 4, CmdTraceProc, &buffer); - result = Tcl_Eval(interp, argv[2]); + result = Tcl_EvalEx(interp, argv[2], -1, 0); if (result == TCL_OK) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); @@ -1987,7 +1987,7 @@ EncodingToUtfProc( TclEncoding *encodingPtr; encodingPtr = (TclEncoding *) clientData; - Tcl_GlobalEval(encodingPtr->interp, encodingPtr->toUtfCmd); + Tcl_EvalEx(encodingPtr->interp,encodingPtr->toUtfCmd,-1,TCL_EVAL_GLOBAL); len = strlen(Tcl_GetStringResult(encodingPtr->interp)); if (len > dstLen) { @@ -2019,7 +2019,7 @@ EncodingFromUtfProc( TclEncoding *encodingPtr; encodingPtr = (TclEncoding *) clientData; - Tcl_GlobalEval(encodingPtr->interp, encodingPtr->fromUtfCmd); + Tcl_EvalEx(encodingPtr->interp, encodingPtr->fromUtfCmd,-1,TCL_EVAL_GLOBAL); len = strlen(Tcl_GetStringResult(encodingPtr->interp)); if (len > dstLen) { diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c index 0d3617e..4d32c5a 100644 --- a/generic/tclTestProcBodyObj.c +++ b/generic/tclTestProcBodyObj.c @@ -143,7 +143,7 @@ RegisterCommand( if (cmdTablePtr->exportIt) { sprintf(buf, "namespace eval %s { namespace export %s }", namespace, cmdTablePtr->cmdName); - if (Tcl_Eval(interp, buf) != TCL_OK) { + if (Tcl_EvalEx(interp, buf, -1, 0) != TCL_OK) { return TCL_ERROR; } } diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 02ee038..75f8a15 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -613,7 +613,7 @@ NewTestThread( */ Tcl_Preserve(tsdPtr->interp); - result = Tcl_Eval(tsdPtr->interp, threadEvalScript); + result = Tcl_EvalEx(tsdPtr->interp, threadEvalScript, -1, 0); if (result != TCL_OK) { ThreadErrorProc(tsdPtr->interp); } @@ -834,7 +834,7 @@ ThreadSend( if (threadId == Tcl_GetCurrentThread()) { Tcl_MutexUnlock(&threadMutex); - return Tcl_GlobalEval(interp, script); + return Tcl_EvalEx(interp, script,-1,TCL_EVAL_GLOBAL); } /* @@ -1029,7 +1029,7 @@ ThreadEventProc( Tcl_Preserve(interp); Tcl_ResetResult(interp); Tcl_CreateThreadExitHandler(ThreadFreeProc, threadEventPtr->script); - code = Tcl_GlobalEval(interp, threadEventPtr->script); + code = Tcl_EvalEx(interp, threadEventPtr->script,-1,TCL_EVAL_GLOBAL); Tcl_DeleteThreadExitHandler(ThreadFreeProc, threadEventPtr->script); if (code != TCL_OK) { errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY); diff --git a/generic/tclTrace.c b/generic/tclTrace.c index fe52d59..4e74c54 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -1889,7 +1889,8 @@ TraceExecutionProc( * interpreter. */ - traceCode = Tcl_Eval(interp, Tcl_DStringValue(&cmd)); + traceCode = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), + Tcl_DStringLength(&cmd), 0); tcmdPtr->flags &= ~TCL_TRACE_EXEC_IN_PROGRESS; /* diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 44dd9e0..ba3e9cb 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -762,7 +762,7 @@ Tcl_ZlibStreamInit( */ if (interp != NULL) { - if (Tcl_Eval(interp, "::incr ::tcl::zlib::cmdcounter") != TCL_OK) { + if (Tcl_EvalEx(interp, "::incr ::tcl::zlib::cmdcounter", -1, 0) != TCL_OK) { goto error; } Tcl_DStringInit(&cmdname); @@ -3816,7 +3816,7 @@ TclZlibInit( * commands. */ - Tcl_Eval(interp, "namespace eval ::tcl::zlib {variable cmdcounter 0}"); + Tcl_EvalEx(interp, "namespace eval ::tcl::zlib {variable cmdcounter 0}", -1, 0); /* * Create the public scripted interface to this file's functionality. diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c index d616352..395cd0e 100644 --- a/unix/dltest/pkge.c +++ b/unix/dltest/pkge.c @@ -50,5 +50,5 @@ Pkge_Init( if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } - return Tcl_Eval(interp, script); + return Tcl_EvalEx(interp, script, -1, 0); } -- cgit v0.12 From 7dd65dcdd0d8e9013803356230cce9a9ac6dfef3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Jan 2016 15:00:49 +0000 Subject: One more Tcl_GlobalEval() usage. --- generic/tclTest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 284d80a..5468c56 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -4507,7 +4507,7 @@ TestfeventCmd( return TCL_ERROR; } if (interp2 != NULL) { - code = Tcl_GlobalEval(interp2, argv[2]); + code = Tcl_EvalEx(interp2, argv[2], -1, TCL_EVAL_GLOBAL); Tcl_SetObjResult(interp, Tcl_GetObjResult(interp2)); return code; } else { -- cgit v0.12 From 28d25fa6cf8d801e60d1d41099179e356ef8ecae Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Tue, 19 Jan 2016 17:48:25 +0000 Subject: Update comment with TIP number. --- generic/tclBasic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 0bb43cc..e5d7406 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -916,7 +916,7 @@ Tcl_CreateInterp(void) TclInitEmbeddedConfigurationInformation(interp); /* - * TIP #XXX: Declare the name of the script engine to be "Tcl". + * TIP #440: Declare the name of the script engine to be "Tcl". */ Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl", -- cgit v0.12 From 093b0618b6e6bef06c090aab243ad716995ba4b5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 21 Jan 2016 13:11:15 +0000 Subject: Fix compiler warnings (discovered on latest clang/gcc6), suggested by Gustaf Neumann. All harmless, no change of functionality. --- generic/tclClock.c | 10 ++++++---- generic/tclExecute.c | 12 +++++++----- macosx/tclMacOSXBundle.c | 4 +--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index 32ba145..782c681 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -562,8 +562,9 @@ ClockGetjuliandayfromerayearmonthdayObjCmd ( || TclGetIntFromObj(interp, fieldPtr, &(fields.dayOfMonth)) != TCL_OK || TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) { - if (fieldPtr == NULL) - Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1)); + if (fieldPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1)); + } return TCL_ERROR; } fields.era = era; @@ -655,8 +656,9 @@ ClockGetjuliandayfromerayearweekdayObjCmd ( || fieldPtr == NULL || TclGetIntFromObj(interp, fieldPtr, &(fields.dayOfWeek)) != TCL_OK || TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) { - if (fieldPtr == NULL) - Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1)); + if (fieldPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1)); + } return TCL_ERROR; } fields.era = era; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 248b1b3..bfb9d17 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -280,6 +280,8 @@ VarHashCreateVar( #define CURR_DEPTH (tosPtr - initTosPtr) +#define STACK_BASE(esPtr) ((esPtr)->stackWords - 1) + /* * Macros used to trace instruction execution. The macros TRACE, * TRACE_WITH_OBJ, and O2S are only used inside TclExecuteByteCode. O2S is @@ -722,7 +724,7 @@ TclCreateExecEnv( esPtr->nextPtr = NULL; esPtr->markerPtr = NULL; esPtr->endPtr = &esPtr->stackWords[TCL_STACK_INITIAL_SIZE-1]; - esPtr->tosPtr = &esPtr->stackWords[-1]; + esPtr->tosPtr = STACK_BASE(esPtr); Tcl_MutexLock(&execMutex); if (!execInitialized) { @@ -934,8 +936,8 @@ GrowEvaluationStack( if (esPtr->nextPtr) { oldPtr = esPtr; esPtr = oldPtr->nextPtr; - currElems = esPtr->endPtr - &esPtr->stackWords[-1]; - if (esPtr->markerPtr || (esPtr->tosPtr != &esPtr->stackWords[-1])) { + currElems = esPtr->endPtr - STACK_BASE(esPtr); + if (esPtr->markerPtr || (esPtr->tosPtr != STACK_BASE(esPtr))) { Tcl_Panic("STACK: Stack after current is in use"); } if (esPtr->nextPtr) { @@ -947,7 +949,7 @@ GrowEvaluationStack( DeleteExecStack(esPtr); esPtr = oldPtr; } else { - currElems = esPtr->endPtr - &esPtr->stackWords[-1]; + currElems = esPtr->endPtr - STACK_BASE(esPtr); } /* @@ -1089,7 +1091,7 @@ TclStackFree( * Return to previous stack. */ - esPtr->tosPtr = &esPtr->stackWords[-1]; + esPtr->tosPtr = STACK_BASE(esPtr); if (esPtr->prevPtr) { eePtr->execStackPtr = esPtr->prevPtr; } diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index c4fc82d..b2a88e5 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -237,9 +237,7 @@ Tcl_MacOSXOpenVersionedBundleResources( } if (openresourcemap) { - short refNum; - - refNum = openresourcemap(bundleRef); + openresourcemap(bundleRef); } } -- cgit v0.12 From 0ea26c667c774bfee4e090ec52f391fad0af7ca5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 22 Jan 2016 10:27:29 +0000 Subject: Improve code 'quality' by fixing some harmless clang/cppcheck warnings. Thanks to Gustaf Neumann. No change in functionality. --- generic/tclIORChan.c | 9 +++--- generic/tclInterp.c | 1 - generic/tclVar.c | 82 ++++++++++++++++++++++++++++++++-------------------- 3 files changed, 55 insertions(+), 37 deletions(-) diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index bbb5b88..c9939d6 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -516,7 +516,6 @@ TclChanCreateObjCmd( * Expect at least one list element. Abbreviations are ok. */ - modeObj = objv[MODE]; if (EncodeEventMask(interp, "mode", objv[MODE], &mode) != TCL_OK) { return TCL_ERROR; } @@ -1109,7 +1108,7 @@ ReflectClose( if (rcPtr->interp) { rcmPtr = GetReflectedChannelMap (rcPtr->interp); - hPtr = Tcl_FindHashEntry (&rcmPtr->map, + hPtr = Tcl_FindHashEntry (&rcmPtr->map, Tcl_GetChannelName (rcPtr->chan)); if (hPtr) { Tcl_DeleteHashEntry (hPtr); @@ -1117,7 +1116,7 @@ ReflectClose( } #ifdef TCL_THREADS rcmPtr = GetThreadReflectedChannelMap(); - hPtr = Tcl_FindHashEntry (&rcmPtr->map, + hPtr = Tcl_FindHashEntry (&rcmPtr->map, Tcl_GetChannelName (rcPtr->chan)); if (hPtr) { Tcl_DeleteHashEntry (hPtr); @@ -2750,12 +2749,12 @@ ForwardProc( */ rcmPtr = GetReflectedChannelMap (interp); - hPtr = Tcl_FindHashEntry (&rcmPtr->map, + hPtr = Tcl_FindHashEntry (&rcmPtr->map, Tcl_GetChannelName (rcPtr->chan)); Tcl_DeleteHashEntry (hPtr); rcmPtr = GetThreadReflectedChannelMap(); - hPtr = Tcl_FindHashEntry (&rcmPtr->map, + hPtr = Tcl_FindHashEntry (&rcmPtr->map, Tcl_GetChannelName (rcPtr->chan)); Tcl_DeleteHashEntry (hPtr); diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 0231909..dbbf10a 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -1748,7 +1748,6 @@ AliasObjCmd( cmdv = (Tcl_Obj **) TclStackAlloc(interp, cmdc*(int)sizeof(Tcl_Obj*)); } - prefv = &aliasPtr->objPtr; memcpy(cmdv, prefv, (size_t) (prefc * sizeof(Tcl_Obj *))); memcpy(cmdv+prefc, objv+1, (size_t) ((objc-1) * sizeof(Tcl_Obj *))); diff --git a/generic/tclVar.c b/generic/tclVar.c index c013e8d..bdc64b7 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -916,7 +916,7 @@ TclLookupSimpleVar( * the variable. */ Namespace *varNsPtr, *cxtNsPtr, *dummy1Ptr, *dummy2Ptr; ResolverScheme *resPtr; - int isNew, i, result; + int isNew; const char *varName = TclGetString(varNamePtr); varPtr = NULL; @@ -937,6 +937,8 @@ TclLookupSimpleVar( if ((cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL) && !(flags & AVOID_RESOLVERS)) { + int result; + resPtr = iPtr->resolverPtr; if (cxtNsPtr->varResProc) { result = (*cxtNsPtr->varResProc)(interp, varName, @@ -1006,9 +1008,10 @@ TclLookupSimpleVar( (Tcl_Namespace *) cxtNsPtr, (flags | AVOID_RESOLVERS) & ~TCL_LEAVE_ERR_MSG); if (varPtr == NULL) { - Tcl_Obj *tailPtr; if (create) { /* Var wasn't found so create it. */ + Tcl_Obj *tailPtr; + TclGetNamespaceForQualName(interp, varName, cxtNsPtr, flags, &varNsPtr, &dummy1Ptr, &dummy2Ptr, &tail); if (varNsPtr == NULL) { @@ -1044,6 +1047,7 @@ TclLookupSimpleVar( } else { /* Local var: look in frame varFramePtr. */ int localCt = varFramePtr->numCompiledLocals; Tcl_Obj **objPtrPtr = &varFramePtr->localCachePtr->varName0; + int i; for (i=0 ; iflags & VAR_TRACED_UNSET))) { + Tcl_HashEntry *tPtr = NULL; + dummyVar.flags &= ~VAR_TRACE_ACTIVE; TclObjCallVarTraces(iPtr, arrayPtr, &dummyVar, part1Ptr, part2Ptr, (flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)) @@ -2581,10 +2587,8 @@ Tcl_AppendObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Var *varPtr, *arrayPtr; register Tcl_Obj *varValuePtr = NULL; /* Initialized to avoid compiler warning. */ - int i; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?value value ...?"); @@ -2597,6 +2601,9 @@ Tcl_AppendObjCmd( return TCL_ERROR; } } else { + Var *arrayPtr, *varPtr; + int i; + varPtr = TclObjLookupVarEx(interp, objv[1], NULL, TCL_LEAVE_ERR_MSG, "set", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); if (varPtr == NULL) { @@ -2648,8 +2655,7 @@ Tcl_LappendObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Obj *varValuePtr, *newValuePtr; - int numElems, createdNewObj; - Var *varPtr, *arrayPtr; + int numElems; int result; if (objc < 2) { @@ -2677,6 +2683,9 @@ Tcl_LappendObjCmd( } } } else { + Var *varPtr, *arrayPtr; + int createdNewObj = 0; + /* * We have arguments to append. We used to call Tcl_SetVar2 to append * each argument one at a time to ensure that traces were run for each @@ -2687,8 +2696,6 @@ Tcl_LappendObjCmd( * copy to modify: this is "copy on write". */ - createdNewObj = 0; - /* * Protect the variable pointers around the TclPtrGetVar call * to insure that they remain valid even if the variable was undefined @@ -2870,10 +2877,8 @@ Tcl_ArrayObjCmd( return TCL_ERROR; } while (1) { - Var *varPtr2; - if (searchPtr->nextEntry != NULL) { - varPtr2 = VarHashGetValue(searchPtr->nextEntry); + Var *varPtr2 = VarHashGetValue(searchPtr->nextEntry); if (!TclIsVarUndefined(varPtr2)) { break; } @@ -3303,7 +3308,6 @@ Tcl_ArrayObjCmd( case ARRAY_SIZE: { Tcl_HashSearch search; - Var *varPtr2; int size; if (objc != 3) { @@ -3318,6 +3322,8 @@ Tcl_ArrayObjCmd( */ if (!notArray) { + Var *varPtr2; + for (varPtr2=VarHashFirstVar(varPtr->value.tablePtr, &search); varPtr2!=NULL ; varPtr2=VarHashNextVar(&search)) { if (TclIsVarUndefined(varPtr2)) { @@ -3661,7 +3667,7 @@ TclPtrMakeUpvar( } /* Callers must Incr myNamePtr if they plan to Decr it. */ - + int TclPtrObjMakeUpvar( Tcl_Interp *interp, /* Interpreter containing variables. Used for @@ -3676,7 +3682,7 @@ TclPtrObjMakeUpvar( { Interp *iPtr = (Interp *) interp; CallFrame *varFramePtr = iPtr->varFramePtr; - const char *errMsg, *p, *myName; + const char *errMsg, *myName; Var *varPtr; if (index >= 0) { @@ -3687,6 +3693,7 @@ TclPtrObjMakeUpvar( myNamePtr = localName(iPtr->varFramePtr, index); myName = myNamePtr? TclGetString(myNamePtr) : NULL; } else { + const char *p; /* * Do not permit the new variable to look like an array reference, as * it will not be reachable in that case [Bug 600812, TIP 184]. The @@ -3889,8 +3896,6 @@ Tcl_GetVariableFullName( { Interp *iPtr = (Interp *) interp; register Var *varPtr = (Var *) variable; - Tcl_Obj *namePtr; - Namespace *nsPtr; /* * Add the full name of the containing namespace (if any), followed by the @@ -3899,6 +3904,9 @@ Tcl_GetVariableFullName( if (varPtr) { if (!TclIsVarArrayElement(varPtr)) { + Tcl_Obj *namePtr; + Namespace *nsPtr; + nsPtr = TclGetVarNsPtr(varPtr); if (nsPtr) { Tcl_AppendToObj(objPtr, nsPtr->fullName, -1); @@ -3952,7 +3960,7 @@ Tcl_GlobalObjCmd( register Tcl_Obj *objPtr, *tailPtr; char *varName; register char *tail; - int result, i; + int i; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "varName ?varName ...?"); @@ -3968,6 +3976,8 @@ Tcl_GlobalObjCmd( } for (i=1 ; iflags & VAR_SEARCH_ACTIVE) { + ArraySearch *searchPtr, *nextPtr; + Tcl_HashEntry *sPtr; + sPtr = Tcl_FindHashEntry(&iPtr->varSearches, (char *) arrayVarPtr); for (searchPtr = (ArraySearch *) Tcl_GetHashValue(sPtr); searchPtr != NULL; searchPtr = nextPtr) { @@ -4919,9 +4930,10 @@ DupParsedVarName( register Tcl_Obj *arrayPtr = srcPtr->internalRep.twoPtrValue.ptr1; register char *elem = srcPtr->internalRep.twoPtrValue.ptr2; char *elemCopy; - unsigned int elemLen; if (arrayPtr != NULL) { + unsigned int elemLen; + Tcl_IncrRefCount(arrayPtr); elemLen = strlen(elem); elemCopy = ckalloc(elemLen+1); @@ -5048,7 +5060,6 @@ ObjFindNamespaceVar( const char *simpleName; Var *varPtr; register int search; - int result; Tcl_Var var; Tcl_Obj *simpleNamePtr; char *name = TclGetString(namePtr); @@ -5069,6 +5080,8 @@ ObjFindNamespaceVar( if (!(flags & AVOID_RESOLVERS) && (cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL)) { + int result; + resPtr = iPtr->resolverPtr; if (cxtNsPtr->varResProc) { @@ -5161,14 +5174,13 @@ TclInfoVarsCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; - char *varName, *pattern; + char *pattern; const char *simplePattern; Tcl_HashSearch search; - Var *varPtr; Namespace *nsPtr; Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - Tcl_Obj *listPtr, *elemObjPtr; + Tcl_Obj *listPtr; int specificNsInPattern = 0;/* Init. to avoid compiler warning. */ Tcl_Obj *simplePatternPtr = NULL, *varNamePtr; @@ -5224,6 +5236,9 @@ TclInfoVarsCmd( if (!(iPtr->varFramePtr->isProcCallFrame & FRAME_IS_PROC) || specificNsInPattern) { + Var *varPtr; + Tcl_Obj *elemObjPtr; + /* * There is no frame pointer, the frame pointer was pushed only to * activate a namespace, or we are in a procedure call frame but a @@ -5264,9 +5279,11 @@ TclInfoVarsCmd( /* * Have to scan the tables of variables. */ + char *varName; varPtr = VarHashFirstVar(&nsPtr->varTable, &search); while (varPtr) { + if (!TclIsVarUndefined(varPtr) || TclIsVarNamespaceVar(varPtr)) { varNamePtr = VarHashGetKey(varPtr); @@ -5354,11 +5371,11 @@ TclInfoGlobalsCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *varName, *pattern; + char *pattern; Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); Tcl_HashSearch search; Var *varPtr; - Tcl_Obj *listPtr, *varNamePtr, *patternPtr; + Tcl_Obj *listPtr, *patternPtr; if (objc == 1) { pattern = NULL; @@ -5405,6 +5422,9 @@ TclInfoGlobalsCmd( for (varPtr = VarHashFirstVar(&globalNsPtr->varTable, &search); varPtr != NULL; varPtr = VarHashNextVar(&search)) { + char *varName; + Tcl_Obj *varNamePtr; + if (TclIsVarUndefined(varPtr)) { continue; } -- cgit v0.12 From 369bd95896b7a34fbcf1780fe3bcae926771ecbf Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Sat, 23 Jan 2016 19:46:58 +0000 Subject: add a test to insure that callbacks run at the correct C-stack depth while unwinding the NRE stack. --- generic/tclTest.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/nre.test | 4 ++++ 2 files changed, 57 insertions(+) diff --git a/generic/tclTest.c b/generic/tclTest.c index 5468c56..2ea3016 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -412,6 +412,12 @@ static int TestNumUtfCharsCmd(ClientData clientData, static int TestHashSystemHashCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); + +static int NREUnwind_callback(ClientData data[], Tcl_Interp *interp, + int result); +static int TestNREUnwind(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); static int TestNRELevels(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -697,6 +703,8 @@ Tcltest_Init( NULL); #endif /* TCL_NO_DEPRECATED */ + Tcl_CreateObjCommand(interp, "testnreunwind", TestNREUnwind, + NULL, NULL); Tcl_CreateObjCommand(interp, "testnrelevels", TestNRELevels, NULL, NULL); Tcl_CreateObjCommand(interp, "testinterpresolver", TestInterpResolverCmd, @@ -6846,6 +6854,51 @@ TestgetintCmd( } static int +NREUnwind_callback( + ClientData data[], + Tcl_Interp *interp, + int result) +{ + int none; + + if (data[0] == INT2PTR(-1)) { + TclNRAddCallback(interp, NREUnwind_callback, &none, INT2PTR(-1), + INT2PTR(-1), NULL); + } else if (data[1] == INT2PTR(-1)) { + TclNRAddCallback(interp, NREUnwind_callback, data[0], &none, + INT2PTR(-1), NULL); + } else if (data[2] == INT2PTR(-1)) { + TclNRAddCallback(interp, NREUnwind_callback, data[0], data[1], + &none, NULL); + } else { + Tcl_Obj *idata[3]; + idata[0] = Tcl_NewIntObj((int) (data[1] - data[0])); + idata[1] = Tcl_NewIntObj((int) (data[2] - data[0])); + idata[2] = Tcl_NewIntObj((int) ((void *) &none - data[0])); + Tcl_SetObjResult(interp, Tcl_NewListObj(3, idata)); + } + return TCL_OK; +} + +static int +TestNREUnwind( + ClientData clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *const objv[]) +{ + /* + * Insure that callbacks effectively run at the proper level during the + * unwinding of the NRE stack. + */ + + TclNRAddCallback(interp, NREUnwind_callback, INT2PTR(-1), INT2PTR(-1), + INT2PTR(-1), NULL); + return TCL_OK; +} + + +static int TestNRELevels( ClientData clientData, Tcl_Interp *interp, diff --git a/tests/nre.test b/tests/nre.test index e512eac..9df5eb1 100644 --- a/tests/nre.test +++ b/tests/nre.test @@ -64,6 +64,10 @@ if {[testConstraint testnrelevels]} { namespace import testnre::* } +test nre-0.1 {levels while unwinding} { + testnreunwind +} {0 0 0} + test nre-1.1 {self-recursive procs} -setup { proc a i [makebody {a $i}] } -body { -- cgit v0.12 From 9aefb192c71805b6be041d37310d24b5c44914cd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 24 Jan 2016 16:52:56 +0000 Subject: Fix "make test" broken by previous commit --- generic/tclTest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 2ea3016..63a6740 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -6862,13 +6862,13 @@ NREUnwind_callback( int none; if (data[0] == INT2PTR(-1)) { - TclNRAddCallback(interp, NREUnwind_callback, &none, INT2PTR(-1), + Tcl_NRAddCallback(interp, NREUnwind_callback, &none, INT2PTR(-1), INT2PTR(-1), NULL); } else if (data[1] == INT2PTR(-1)) { - TclNRAddCallback(interp, NREUnwind_callback, data[0], &none, + Tcl_NRAddCallback(interp, NREUnwind_callback, data[0], &none, INT2PTR(-1), NULL); } else if (data[2] == INT2PTR(-1)) { - TclNRAddCallback(interp, NREUnwind_callback, data[0], data[1], + Tcl_NRAddCallback(interp, NREUnwind_callback, data[0], data[1], &none, NULL); } else { Tcl_Obj *idata[3]; @@ -6892,7 +6892,7 @@ TestNREUnwind( * unwinding of the NRE stack. */ - TclNRAddCallback(interp, NREUnwind_callback, INT2PTR(-1), INT2PTR(-1), + Tcl_NRAddCallback(interp, NREUnwind_callback, INT2PTR(-1), INT2PTR(-1), INT2PTR(-1), NULL); return TCL_OK; } -- cgit v0.12 From a1db6470b525c61a75fc26133b821ca98d6c66df Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Jan 2016 17:33:21 +0000 Subject: Bump to 8.6.5 --- README | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- unix/configure | 2 +- unix/configure.in | 2 +- unix/tcl.spec | 2 +- win/configure | 2 +- win/configure.in | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index f63e0e7..f3e50dd 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tcl - This is the Tcl 8.6.4 source distribution. + This is the Tcl 8.6.5 source distribution. http://sourceforge.net/projects/tcl/files/Tcl/ You can get any source release of Tcl from the URL above. diff --git a/generic/tcl.h b/generic/tcl.h index a08edde..3490049 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -56,10 +56,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 6 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 4 +#define TCL_RELEASE_SERIAL 5 #define TCL_VERSION "8.6" -#define TCL_PATCH_LEVEL "8.6.4" +#define TCL_PATCH_LEVEL "8.6.5" /* *---------------------------------------------------------------------------- diff --git a/library/init.tcl b/library/init.tcl index 85900d2..9fd2170 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -16,7 +16,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.6.4 +package require -exact Tcl 8.6.5 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/unix/configure b/unix/configure index c19a77a..2e774f7 100755 --- a/unix/configure +++ b/unix/configure @@ -1335,7 +1335,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/configure.in b/unix/configure.in index c7b0edc..5d4cfbe 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/tcl.spec b/unix/tcl.spec index 1b8693f..3044311 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 8.6.4 +Version: 8.6.5 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index 3ebc697..2336111 100755 --- a/win/configure +++ b/win/configure @@ -1311,7 +1311,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.in b/win/configure.in index 9e9df90..a72b993 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From 3fa3e3b2d59022f67a190c83e215f789ce836e2e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 29 Jan 2016 09:46:56 +0000 Subject: Fix gcc'ism. Not all compilers can substract two void pointers. --- generic/tclTest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 63a6740..9794f59 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -6872,9 +6872,9 @@ NREUnwind_callback( &none, NULL); } else { Tcl_Obj *idata[3]; - idata[0] = Tcl_NewIntObj((int) (data[1] - data[0])); - idata[1] = Tcl_NewIntObj((int) (data[2] - data[0])); - idata[2] = Tcl_NewIntObj((int) ((void *) &none - data[0])); + idata[0] = Tcl_NewIntObj((int) ((char *) data[1] - (char *) data[0])); + idata[1] = Tcl_NewIntObj((int) ((char *) data[2] - (char *) data[0])); + idata[2] = Tcl_NewIntObj((int) ((char *) &none - (char *) data[0])); Tcl_SetObjResult(interp, Tcl_NewListObj(3, idata)); } return TCL_OK; -- cgit v0.12 From 8b4717e9ad0214e985ed2fe6ee6d673b9d1cf603 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 3 Feb 2016 15:29:04 +0000 Subject: [25842c161] Prevent zero-length compress actions in [zlib] streaming API. --- generic/tclZlib.c | 33 ++++++++++++++++++--------------- tests/zlib.test | 6 ++++++ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/generic/tclZlib.c b/generic/tclZlib.c index ba3e9cb..6f1d225 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -1164,6 +1164,14 @@ Tcl_ZlibStreamPut( zshPtr->stream.next_in = Tcl_GetByteArrayFromObj(data, &size); zshPtr->stream.avail_in = size; + /* + * Must not do a zero-length compress. [Bug 25842c161] + */ + + if (size == 0) { + return TCL_OK; + } + if (HaveDictToSet(zshPtr)) { e = SetDeflateDictionary(&zshPtr->stream, zshPtr->compDictObj); if (e != Z_OK) { @@ -1186,32 +1194,27 @@ Tcl_ZlibStreamPut( zshPtr->stream.next_out = (Bytef *) dataTmp; e = deflate(&zshPtr->stream, flush); - if ((e==Z_OK || e==Z_BUF_ERROR) && (zshPtr->stream.avail_out == 0)) { - if (outSize - zshPtr->stream.avail_out > 0) { - /* - * Output buffer too small. - */ - - obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp, - outSize - zshPtr->stream.avail_out); + while (e == Z_BUF_ERROR) { + /* + * Output buffer too small to hold the data being generated; so + * put a new buffer into place after saving the old generated + * data to the outData list. + */ - /* - * Now append the compressed data to the outData list. - */ + obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp, outSize); + Tcl_ListObjAppendElement(NULL, zshPtr->outData, obj); - Tcl_ListObjAppendElement(NULL, zshPtr->outData, obj); - } if (outSize < 0xFFFF) { outSize = 0xFFFF; /* There may be *lots* of data left to * output... */ - ckfree(dataTmp); - dataTmp = ckalloc(outSize); + dataTmp = ckrealloc(dataTmp, outSize); } zshPtr->stream.avail_out = outSize; zshPtr->stream.next_out = (Bytef *) dataTmp; e = deflate(&zshPtr->stream, flush); } + if (e != Z_OK && !(flush==Z_FINISH && e==Z_STREAM_END)) { if (zshPtr->interp) { ConvertError(zshPtr->interp, e, zshPtr->stream.adler); diff --git a/tests/zlib.test b/tests/zlib.test index b1d43fb..7a486ba 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -132,6 +132,12 @@ test zlib-7.6 {zlib stream} zlib { $s close lappend result $data } {{} 69f34b6a abcdeEDCBA..} +test zlib-7.7 {zlib stream: Bug 25842c161} -constraints zlib -body { + set s [zlib stream deflate] + $s put {} +} -cleanup { + catch {$s close} +} -result "" test zlib-8.1 {zlib transformation} -constraints zlib -setup { set file [makeFile {} test.gz] -- cgit v0.12 From 006eb9afe0f425b8dba4ee017492ddded2836d9e Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 4 Feb 2016 21:05:02 +0000 Subject: [cf74deb33c] Plug memleaks in class teardown. --- generic/tclOO.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 34eb5ad..4697054 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -913,6 +913,10 @@ ClearMixins( int i; Class *mixinPtr; + if (clsPtr->mixins.num == 0) { + return; + } + FOREACH(mixinPtr, clsPtr->mixins) { TclOORemoveFromMixinSubs(clsPtr, mixinPtr); } @@ -927,6 +931,10 @@ ClearSuperclasses( int i; Class *superPtr; + if (clsPtr->superclasses.num == 0) { + return; + } + FOREACH(superPtr, clsPtr->superclasses) { TclOORemoveFromSubclasses(clsPtr, superPtr); } @@ -1002,16 +1010,11 @@ ReleaseClassContents( */ FOREACH(mixinSubclassPtr, clsPtr->mixinSubs) { - if (mixinSubclassPtr == NULL) { - continue; - } if (!Deleted(mixinSubclassPtr->thisPtr)) { Tcl_DeleteCommandFromToken(interp, mixinSubclassPtr->thisPtr->command); } - if (mixinSubclassPtr->mixins.num) { - ClearMixins(mixinSubclassPtr); - } + ClearMixins(mixinSubclassPtr); DelRef(mixinSubclassPtr->thisPtr); DelRef(mixinSubclassPtr); } @@ -1026,15 +1029,13 @@ ReleaseClassContents( */ FOREACH(subclassPtr, clsPtr->subclasses) { - if (subclassPtr == NULL || IsRoot(subclassPtr)) { + if (IsRoot(subclassPtr)) { continue; } if (!Deleted(subclassPtr->thisPtr)) { Tcl_DeleteCommandFromToken(interp, subclassPtr->thisPtr->command); } - if (subclassPtr->superclasses.num) { - ClearSuperclasses(subclassPtr); - } + ClearSuperclasses(subclassPtr); DelRef(subclassPtr->thisPtr); DelRef(subclassPtr); } @@ -1251,12 +1252,10 @@ ObjectNamespaceDeleted( clsPtr->filters.num = 0; } - if (clsPtr->mixins.num) { - ClearMixins(clsPtr); - } - if (clsPtr->superclasses.num) { - ClearSuperclasses(clsPtr); - } + ClearMixins(clsPtr); + + ClearSuperclasses(clsPtr); + if (clsPtr->subclasses.list) { ckfree(clsPtr->subclasses.list); clsPtr->subclasses.num = 0; @@ -1398,9 +1397,7 @@ TclOORemoveFromSubclasses( return; removeSubclass: - if (Deleted(superPtr->thisPtr)) { - superPtr->subclasses.list[i] = NULL; - } else { + if (!Deleted(superPtr->thisPtr)) { superPtr->subclasses.num--; if (i < superPtr->subclasses.num) { superPtr->subclasses.list[i] = @@ -1471,9 +1468,7 @@ TclOORemoveFromMixinSubs( return; removeSubclass: - if (Deleted(superPtr->thisPtr)) { - superPtr->mixinSubs.list[i] = NULL; - } else { + if (!Deleted(superPtr->thisPtr)) { superPtr->mixinSubs.num--; if (i < superPtr->mixinSubs.num) { superPtr->mixinSubs.list[i] = -- cgit v0.12 From dba2afb18ab071ead67a0d02265405609a89f87c Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 5 Feb 2016 14:36:28 +0000 Subject: Clean up the handling of buffer limit exceeding when flushing a zlib transform. --- generic/tclZlib.c | 85 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 26 deletions(-) diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 6f1d225..50d9a30 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -3109,6 +3109,64 @@ ZlibTransformOutput( /* *---------------------------------------------------------------------- * + * ZlibTransformFlush -- + * + * How to perform a flush of a compressing transform. + * + *---------------------------------------------------------------------- + */ + +static int +ZlibTransformFlush( + Tcl_Interp *interp, + ZlibChannelData *cd, + int flushType) +{ + int e, len; + + cd->outStream.avail_in = 0; + do { + /* + * Get the bytes to go out of the compression engine. + */ + + cd->outStream.next_out = (Bytef *) cd->outBuffer; + cd->outStream.avail_out = cd->outAllocated; + + e = deflate(&cd->outStream, flushType); + if (e != Z_OK && e != Z_BUF_ERROR) { + ConvertError(interp, e, cd->outStream.adler); + return TCL_ERROR; + } + + /* + * Write the bytes we've received to the next layer. + */ + + len = cd->outStream.next_out - (Bytef *) cd->outBuffer; + if (len > 0 && Tcl_WriteRaw(cd->parent, cd->outBuffer, len) < 0) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "problem flushing channel: %s", + Tcl_PosixError(interp))); + return TCL_ERROR; + } + + /* + * If we get to this point, either we're in the Z_OK or the + * Z_BUF_ERROR state. In the former case, we're done. In the latter + * case, it's because there's more bytes to go than would fit in the + * buffer we provided, and we need to go round again to get some more. + * + * We also stop the loop if we would have done a zero-length write. + * Those can cause problems at the OS level. + */ + } while (len > 0 && e == Z_BUF_ERROR); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * * ZlibTransformSetOption -- * * Writing side of [fconfigure] on our channel. @@ -3181,32 +3239,7 @@ ZlibTransformSetOption( /* not used */ * Try to actually do the flush now. */ - cd->outStream.avail_in = 0; - while (1) { - int e; - - cd->outStream.next_out = (Bytef *) cd->outBuffer; - cd->outStream.avail_out = cd->outAllocated; - - e = deflate(&cd->outStream, flushType); - if (e == Z_BUF_ERROR) { - break; - } else if (e != Z_OK) { - ConvertError(interp, e, cd->outStream.adler); - return TCL_ERROR; - } else if (cd->outStream.avail_out == 0) { - break; - } - - if (Tcl_WriteRaw(cd->parent, cd->outBuffer, - cd->outStream.next_out - (Bytef *) cd->outBuffer)<0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "problem flushing channel: %s", - Tcl_PosixError(interp))); - return TCL_ERROR; - } - } - return TCL_OK; + return ZlibTransformFlush(interp, cd, flushType); } } else { if (optionName && strcmp(optionName, "-limit") == 0) { -- cgit v0.12 From b1598dbddda53d7d5886bc8ae50a5b2f8901a1d8 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 5 Feb 2016 16:31:00 +0000 Subject: Tweaking some comments for clarity. --- generic/tclOO.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 4697054..9df5029 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -898,10 +898,10 @@ ObjectRenamedTrace( /* * ---------------------------------------------------------------------- * - * ReleaseClassContents -- + * ClearMixins, ClearSuperclasses -- * - * Tear down the special class data structure, including deleting all - * dependent classes and objects. + * Utility functions for correctly clearing the list of mixins or + * superclasses of a class. Will ckfree() the list storage. * * ---------------------------------------------------------------------- */ @@ -921,6 +921,7 @@ ClearMixins( TclOORemoveFromMixinSubs(clsPtr, mixinPtr); } ckfree(clsPtr->mixins.list); + clsPtr->mixins.list = NULL; clsPtr->mixins.num = 0; } @@ -939,8 +940,20 @@ ClearSuperclasses( TclOORemoveFromSubclasses(clsPtr, superPtr); } ckfree(clsPtr->superclasses.list); + clsPtr->superclasses.list = NULL; clsPtr->superclasses.num = 0; } + +/* + * ---------------------------------------------------------------------- + * + * ReleaseClassContents -- + * + * Tear down the special class data structure, including deleting all + * dependent classes and objects. + * + * ---------------------------------------------------------------------- + */ static void ReleaseClassContents( @@ -1231,6 +1244,10 @@ ObjectNamespaceDeleted( oPtr->metadataPtr = NULL; } + /* + * If this was a class, there's additional deletion work to do. + */ + if (clsPtr != NULL) { Tcl_ObjectMetadataType *metadataTypePtr; ClientData value; -- cgit v0.12 From 0260a79109b7ac74aa3ef49221b411aacedc695f Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 11 Feb 2016 09:27:00 +0000 Subject: Fix minor formatting glitch --- doc/file.n | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/file.n b/doc/file.n index 4c6465a..cef3c64 100644 --- a/doc/file.n +++ b/doc/file.n @@ -23,7 +23,7 @@ substitution is done before executing the command (see the manual entry for file name. Any unique abbreviation for \fIoption\fR is acceptable. The valid options are: .TP -\fBfile atime \fIname\fR ?\fBtime\fR? +\fBfile atime \fIname\fR ?\fItime\fR? . Returns a decimal string giving the time at which file \fIname\fR was last accessed. If \fItime\fR is specified, it is an access time to set @@ -34,9 +34,9 @@ generated. On Windows, FAT file systems do not support access time. .TP \fBfile attributes \fIname\fR .TP -\fBfile attributes \fIname\fR ?\fBoption\fR? +\fBfile attributes \fIname\fR ?\fIoption\fR? .TP -\fBfile attributes \fIname\fR ?\fBoption value option value...\fR? +\fBfile attributes \fIname\fR ?\fIoption value option value...\fR? . This subcommand returns or sets platform specific values associated with a file. The first form returns a list of the platform specific -- cgit v0.12 From f7ea5b6cc57fafcbcb3377e83fdbc4d999d123d4 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 11 Feb 2016 09:31:31 +0000 Subject: Fix a few more very minor formatting glitches. --- doc/file.n | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/file.n b/doc/file.n index cef3c64..9f89f6d 100644 --- a/doc/file.n +++ b/doc/file.n @@ -80,7 +80,7 @@ set to the value 0, which results in the resource fork being stripped off the file. .RE .TP -\fBfile channels ?\fIpattern\fR? +\fBfile channels\fR ?\fIpattern\fR? . If \fIpattern\fR is not specified, returns a list of names of all registered open channels in this interpreter. If \fIpattern\fR is @@ -203,7 +203,7 @@ is always canonical for the current platform: \fB/\fR for Unix and Windows. .RE .TP -\fBfile link ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR? +\fBfile link\fR ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR? . If only one argument is given, that argument is assumed to be \fIlinkName\fR, and this command returns the value of the link given by @@ -255,7 +255,7 @@ is for the link rather than the file it refers to. On systems that do not support symbolic links this option behaves exactly the same as the \fBstat\fR option. .TP -\fBfile mkdir ?\fIdir\fR ...? +\fBfile mkdir\fR ?\fIdir\fR ...? . Creates each directory specified. For each pathname \fIdir\fR specified, this command will create all non-existing parent directories as -- cgit v0.12 From 52862d4aeb45df2aad6c9d0b2ef00fcb89790be8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 19 Feb 2016 10:49:57 +0000 Subject: Proposed fix for [9b47029467631832]: testing existence of env(some_thing) destroys traces. Was the comment [http://core.tcl.tk/tcl/artifact/f93c0675115b73ce?ln=554|here] not correct after all?. --- generic/tclEnv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclEnv.c b/generic/tclEnv.c index 2cb240d..66ddb57 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -551,7 +551,8 @@ TclGetEnv( * array. * * Results: - * Always returns NULL to indicate success. + * Returns NULL to indicate success, or an error-message if the array + * element being handled doesn't exist. * * Side effects: * Environment variable changes get propagated. If the whole "env" array @@ -609,8 +610,7 @@ EnvTraceProc( const char *value = TclGetEnv(name2, &valueString); if (value == NULL) { - Tcl_UnsetVar2(interp, name1, name2, 0); - return NULL; + return (char *) "no such variable"; } Tcl_SetVar2(interp, name1, name2, value, 0); Tcl_DStringFree(&valueString); -- cgit v0.12 From 5a2bdabcbd24d2e6cf0483f1e6ae68d17abff108 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 19 Feb 2016 13:37:11 +0000 Subject: Update to tzdata2016a. --- library/tzdata/America/Cayman | 177 +--------------------- library/tzdata/America/Metlakatla | 169 +++++++++++++++++++++ library/tzdata/America/Santa_Isabel | 285 +----------------------------------- library/tzdata/Asia/Chita | 1 + library/tzdata/Asia/Karachi | 4 +- library/tzdata/Asia/Tehran | 124 ++++++++++++++++ 6 files changed, 302 insertions(+), 458 deletions(-) diff --git a/library/tzdata/America/Cayman b/library/tzdata/America/Cayman index 5231ca9..92ce5e2 100644 --- a/library/tzdata/America/Cayman +++ b/library/tzdata/America/Cayman @@ -1,176 +1,5 @@ # created by tools/tclZIC.tcl - do not edit - -set TZData(:America/Cayman) { - {-9223372036854775808 -19532 0 LMT} - {-2524502068 -18431 0 KMT} - {-1827687169 -18000 0 EST} - {1451624400 -18000 0 EST} - {1457852400 -14400 1 EDT} - {1478412000 -18000 0 EST} - {1489302000 -14400 1 EDT} - {1509861600 -18000 0 EST} - {1520751600 -14400 1 EDT} - {1541311200 -18000 0 EST} - {1552201200 -14400 1 EDT} - {1572760800 -18000 0 EST} - {1583650800 -14400 1 EDT} - {1604210400 -18000 0 EST} - {1615705200 -14400 1 EDT} - {1636264800 -18000 0 EST} - {1647154800 -14400 1 EDT} - {1667714400 -18000 0 EST} - {1678604400 -14400 1 EDT} - {1699164000 -18000 0 EST} - {1710054000 -14400 1 EDT} - {1730613600 -18000 0 EST} - {1741503600 -14400 1 EDT} - {1762063200 -18000 0 EST} - {1772953200 -14400 1 EDT} - {1793512800 -18000 0 EST} - {1805007600 -14400 1 EDT} - {1825567200 -18000 0 EST} - {1836457200 -14400 1 EDT} - {1857016800 -18000 0 EST} - {1867906800 -14400 1 EDT} - {1888466400 -18000 0 EST} - {1899356400 -14400 1 EDT} - {1919916000 -18000 0 EST} - {1930806000 -14400 1 EDT} - {1951365600 -18000 0 EST} - {1962860400 -14400 1 EDT} - {1983420000 -18000 0 EST} - {1994310000 -14400 1 EDT} - {2014869600 -18000 0 EST} - {2025759600 -14400 1 EDT} - {2046319200 -18000 0 EST} - {2057209200 -14400 1 EDT} - {2077768800 -18000 0 EST} - {2088658800 -14400 1 EDT} - {2109218400 -18000 0 EST} - {2120108400 -14400 1 EDT} - {2140668000 -18000 0 EST} - {2152162800 -14400 1 EDT} - {2172722400 -18000 0 EST} - {2183612400 -14400 1 EDT} - {2204172000 -18000 0 EST} - {2215062000 -14400 1 EDT} - {2235621600 -18000 0 EST} - {2246511600 -14400 1 EDT} - {2267071200 -18000 0 EST} - {2277961200 -14400 1 EDT} - {2298520800 -18000 0 EST} - {2309410800 -14400 1 EDT} - {2329970400 -18000 0 EST} - {2341465200 -14400 1 EDT} - {2362024800 -18000 0 EST} - {2372914800 -14400 1 EDT} - {2393474400 -18000 0 EST} - {2404364400 -14400 1 EDT} - {2424924000 -18000 0 EST} - {2435814000 -14400 1 EDT} - {2456373600 -18000 0 EST} - {2467263600 -14400 1 EDT} - {2487823200 -18000 0 EST} - {2499318000 -14400 1 EDT} - {2519877600 -18000 0 EST} - {2530767600 -14400 1 EDT} - {2551327200 -18000 0 EST} - {2562217200 -14400 1 EDT} - {2582776800 -18000 0 EST} - {2593666800 -14400 1 EDT} - {2614226400 -18000 0 EST} - {2625116400 -14400 1 EDT} - {2645676000 -18000 0 EST} - {2656566000 -14400 1 EDT} - {2677125600 -18000 0 EST} - {2688620400 -14400 1 EDT} - {2709180000 -18000 0 EST} - {2720070000 -14400 1 EDT} - {2740629600 -18000 0 EST} - {2751519600 -14400 1 EDT} - {2772079200 -18000 0 EST} - {2782969200 -14400 1 EDT} - {2803528800 -18000 0 EST} - {2814418800 -14400 1 EDT} - {2834978400 -18000 0 EST} - {2846473200 -14400 1 EDT} - {2867032800 -18000 0 EST} - {2877922800 -14400 1 EDT} - {2898482400 -18000 0 EST} - {2909372400 -14400 1 EDT} - {2929932000 -18000 0 EST} - {2940822000 -14400 1 EDT} - {2961381600 -18000 0 EST} - {2972271600 -14400 1 EDT} - {2992831200 -18000 0 EST} - {3003721200 -14400 1 EDT} - {3024280800 -18000 0 EST} - {3035775600 -14400 1 EDT} - {3056335200 -18000 0 EST} - {3067225200 -14400 1 EDT} - {3087784800 -18000 0 EST} - {3098674800 -14400 1 EDT} - {3119234400 -18000 0 EST} - {3130124400 -14400 1 EDT} - {3150684000 -18000 0 EST} - {3161574000 -14400 1 EDT} - {3182133600 -18000 0 EST} - {3193023600 -14400 1 EDT} - {3213583200 -18000 0 EST} - {3225078000 -14400 1 EDT} - {3245637600 -18000 0 EST} - {3256527600 -14400 1 EDT} - {3277087200 -18000 0 EST} - {3287977200 -14400 1 EDT} - {3308536800 -18000 0 EST} - {3319426800 -14400 1 EDT} - {3339986400 -18000 0 EST} - {3350876400 -14400 1 EDT} - {3371436000 -18000 0 EST} - {3382930800 -14400 1 EDT} - {3403490400 -18000 0 EST} - {3414380400 -14400 1 EDT} - {3434940000 -18000 0 EST} - {3445830000 -14400 1 EDT} - {3466389600 -18000 0 EST} - {3477279600 -14400 1 EDT} - {3497839200 -18000 0 EST} - {3508729200 -14400 1 EDT} - {3529288800 -18000 0 EST} - {3540178800 -14400 1 EDT} - {3560738400 -18000 0 EST} - {3572233200 -14400 1 EDT} - {3592792800 -18000 0 EST} - {3603682800 -14400 1 EDT} - {3624242400 -18000 0 EST} - {3635132400 -14400 1 EDT} - {3655692000 -18000 0 EST} - {3666582000 -14400 1 EDT} - {3687141600 -18000 0 EST} - {3698031600 -14400 1 EDT} - {3718591200 -18000 0 EST} - {3730086000 -14400 1 EDT} - {3750645600 -18000 0 EST} - {3761535600 -14400 1 EDT} - {3782095200 -18000 0 EST} - {3792985200 -14400 1 EDT} - {3813544800 -18000 0 EST} - {3824434800 -14400 1 EDT} - {3844994400 -18000 0 EST} - {3855884400 -14400 1 EDT} - {3876444000 -18000 0 EST} - {3887334000 -14400 1 EDT} - {3907893600 -18000 0 EST} - {3919388400 -14400 1 EDT} - {3939948000 -18000 0 EST} - {3950838000 -14400 1 EDT} - {3971397600 -18000 0 EST} - {3982287600 -14400 1 EDT} - {4002847200 -18000 0 EST} - {4013737200 -14400 1 EDT} - {4034296800 -18000 0 EST} - {4045186800 -14400 1 EDT} - {4065746400 -18000 0 EST} - {4076636400 -14400 1 EDT} - {4097196000 -18000 0 EST} +if {![info exists TZData(America/Panama)]} { + LoadTimeZoneFile America/Panama } +set TZData(:America/Cayman) $TZData(:America/Panama) diff --git a/library/tzdata/America/Metlakatla b/library/tzdata/America/Metlakatla index 8ea80fa..407948d 100644 --- a/library/tzdata/America/Metlakatla +++ b/library/tzdata/America/Metlakatla @@ -40,4 +40,173 @@ set TZData(:America/Metlakatla) { {404902800 -28800 0 PST} {420026400 -25200 1 PDT} {436356000 -28800 0 PST} + {1446372000 -32400 0 AKST} + {1457866800 -28800 1 AKDT} + {1478426400 -32400 0 AKST} + {1489316400 -28800 1 AKDT} + {1509876000 -32400 0 AKST} + {1520766000 -28800 1 AKDT} + {1541325600 -32400 0 AKST} + {1552215600 -28800 1 AKDT} + {1572775200 -32400 0 AKST} + {1583665200 -28800 1 AKDT} + {1604224800 -32400 0 AKST} + {1615719600 -28800 1 AKDT} + {1636279200 -32400 0 AKST} + {1647169200 -28800 1 AKDT} + {1667728800 -32400 0 AKST} + {1678618800 -28800 1 AKDT} + {1699178400 -32400 0 AKST} + {1710068400 -28800 1 AKDT} + {1730628000 -32400 0 AKST} + {1741518000 -28800 1 AKDT} + {1762077600 -32400 0 AKST} + {1772967600 -28800 1 AKDT} + {1793527200 -32400 0 AKST} + {1805022000 -28800 1 AKDT} + {1825581600 -32400 0 AKST} + {1836471600 -28800 1 AKDT} + {1857031200 -32400 0 AKST} + {1867921200 -28800 1 AKDT} + {1888480800 -32400 0 AKST} + {1899370800 -28800 1 AKDT} + {1919930400 -32400 0 AKST} + {1930820400 -28800 1 AKDT} + {1951380000 -32400 0 AKST} + {1962874800 -28800 1 AKDT} + {1983434400 -32400 0 AKST} + {1994324400 -28800 1 AKDT} + {2014884000 -32400 0 AKST} + {2025774000 -28800 1 AKDT} + {2046333600 -32400 0 AKST} + {2057223600 -28800 1 AKDT} + {2077783200 -32400 0 AKST} + {2088673200 -28800 1 AKDT} + {2109232800 -32400 0 AKST} + {2120122800 -28800 1 AKDT} + {2140682400 -32400 0 AKST} + {2152177200 -28800 1 AKDT} + {2172736800 -32400 0 AKST} + {2183626800 -28800 1 AKDT} + {2204186400 -32400 0 AKST} + {2215076400 -28800 1 AKDT} + {2235636000 -32400 0 AKST} + {2246526000 -28800 1 AKDT} + {2267085600 -32400 0 AKST} + {2277975600 -28800 1 AKDT} + {2298535200 -32400 0 AKST} + {2309425200 -28800 1 AKDT} + {2329984800 -32400 0 AKST} + {2341479600 -28800 1 AKDT} + {2362039200 -32400 0 AKST} + {2372929200 -28800 1 AKDT} + {2393488800 -32400 0 AKST} + {2404378800 -28800 1 AKDT} + {2424938400 -32400 0 AKST} + {2435828400 -28800 1 AKDT} + {2456388000 -32400 0 AKST} + {2467278000 -28800 1 AKDT} + {2487837600 -32400 0 AKST} + {2499332400 -28800 1 AKDT} + {2519892000 -32400 0 AKST} + {2530782000 -28800 1 AKDT} + {2551341600 -32400 0 AKST} + {2562231600 -28800 1 AKDT} + {2582791200 -32400 0 AKST} + {2593681200 -28800 1 AKDT} + {2614240800 -32400 0 AKST} + {2625130800 -28800 1 AKDT} + {2645690400 -32400 0 AKST} + {2656580400 -28800 1 AKDT} + {2677140000 -32400 0 AKST} + {2688634800 -28800 1 AKDT} + {2709194400 -32400 0 AKST} + {2720084400 -28800 1 AKDT} + {2740644000 -32400 0 AKST} + {2751534000 -28800 1 AKDT} + {2772093600 -32400 0 AKST} + {2782983600 -28800 1 AKDT} + {2803543200 -32400 0 AKST} + {2814433200 -28800 1 AKDT} + {2834992800 -32400 0 AKST} + {2846487600 -28800 1 AKDT} + {2867047200 -32400 0 AKST} + {2877937200 -28800 1 AKDT} + {2898496800 -32400 0 AKST} + {2909386800 -28800 1 AKDT} + {2929946400 -32400 0 AKST} + {2940836400 -28800 1 AKDT} + {2961396000 -32400 0 AKST} + {2972286000 -28800 1 AKDT} + {2992845600 -32400 0 AKST} + {3003735600 -28800 1 AKDT} + {3024295200 -32400 0 AKST} + {3035790000 -28800 1 AKDT} + {3056349600 -32400 0 AKST} + {3067239600 -28800 1 AKDT} + {3087799200 -32400 0 AKST} + {3098689200 -28800 1 AKDT} + {3119248800 -32400 0 AKST} + {3130138800 -28800 1 AKDT} + {3150698400 -32400 0 AKST} + {3161588400 -28800 1 AKDT} + {3182148000 -32400 0 AKST} + {3193038000 -28800 1 AKDT} + {3213597600 -32400 0 AKST} + {3225092400 -28800 1 AKDT} + {3245652000 -32400 0 AKST} + {3256542000 -28800 1 AKDT} + {3277101600 -32400 0 AKST} + {3287991600 -28800 1 AKDT} + {3308551200 -32400 0 AKST} + {3319441200 -28800 1 AKDT} + {3340000800 -32400 0 AKST} + {3350890800 -28800 1 AKDT} + {3371450400 -32400 0 AKST} + {3382945200 -28800 1 AKDT} + {3403504800 -32400 0 AKST} + {3414394800 -28800 1 AKDT} + {3434954400 -32400 0 AKST} + {3445844400 -28800 1 AKDT} + {3466404000 -32400 0 AKST} + {3477294000 -28800 1 AKDT} + {3497853600 -32400 0 AKST} + {3508743600 -28800 1 AKDT} + {3529303200 -32400 0 AKST} + {3540193200 -28800 1 AKDT} + {3560752800 -32400 0 AKST} + {3572247600 -28800 1 AKDT} + {3592807200 -32400 0 AKST} + {3603697200 -28800 1 AKDT} + {3624256800 -32400 0 AKST} + {3635146800 -28800 1 AKDT} + {3655706400 -32400 0 AKST} + {3666596400 -28800 1 AKDT} + {3687156000 -32400 0 AKST} + {3698046000 -28800 1 AKDT} + {3718605600 -32400 0 AKST} + {3730100400 -28800 1 AKDT} + {3750660000 -32400 0 AKST} + {3761550000 -28800 1 AKDT} + {3782109600 -32400 0 AKST} + {3792999600 -28800 1 AKDT} + {3813559200 -32400 0 AKST} + {3824449200 -28800 1 AKDT} + {3845008800 -32400 0 AKST} + {3855898800 -28800 1 AKDT} + {3876458400 -32400 0 AKST} + {3887348400 -28800 1 AKDT} + {3907908000 -32400 0 AKST} + {3919402800 -28800 1 AKDT} + {3939962400 -32400 0 AKST} + {3950852400 -28800 1 AKDT} + {3971412000 -32400 0 AKST} + {3982302000 -28800 1 AKDT} + {4002861600 -32400 0 AKST} + {4013751600 -28800 1 AKDT} + {4034311200 -32400 0 AKST} + {4045201200 -28800 1 AKDT} + {4065760800 -32400 0 AKST} + {4076650800 -28800 1 AKDT} + {4097210400 -32400 0 AKST} } diff --git a/library/tzdata/America/Santa_Isabel b/library/tzdata/America/Santa_Isabel index 87cb5a8..a3a3b4f 100644 --- a/library/tzdata/America/Santa_Isabel +++ b/library/tzdata/America/Santa_Isabel @@ -1,284 +1,5 @@ # created by tools/tclZIC.tcl - do not edit - -set TZData(:America/Santa_Isabel) { - {-9223372036854775808 -27568 0 LMT} - {-1514736000 -25200 0 MST} - {-1451667600 -28800 0 PST} - {-1343062800 -25200 0 MST} - {-1234803600 -28800 0 PST} - {-1222963200 -25200 1 PDT} - {-1207242000 -28800 0 PST} - {-873820800 -25200 1 PWT} - {-769395600 -25200 1 PPT} - {-761677200 -28800 0 PST} - {-686073600 -25200 1 PDT} - {-661539600 -28800 0 PST} - {-504892800 -28800 0 PST} - {-495036000 -25200 1 PDT} - {-481734000 -28800 0 PST} - {-463586400 -25200 1 PDT} - {-450284400 -28800 0 PST} - {-431532000 -25200 1 PDT} - {-418230000 -28800 0 PST} - {-400082400 -25200 1 PDT} - {-386780400 -28800 0 PST} - {-368632800 -25200 1 PDT} - {-355330800 -28800 0 PST} - {-337183200 -25200 1 PDT} - {-323881200 -28800 0 PST} - {-305733600 -25200 1 PDT} - {-292431600 -28800 0 PST} - {-283968000 -28800 0 PST} - {189331200 -28800 0 PST} - {199274400 -25200 1 PDT} - {215600400 -28800 0 PST} - {230724000 -25200 1 PDT} - {247050000 -28800 0 PST} - {262778400 -25200 1 PDT} - {278499600 -28800 0 PST} - {294228000 -25200 1 PDT} - {309949200 -28800 0 PST} - {325677600 -25200 1 PDT} - {341398800 -28800 0 PST} - {357127200 -25200 1 PDT} - {372848400 -28800 0 PST} - {388576800 -25200 1 PDT} - {404902800 -28800 0 PST} - {420026400 -25200 1 PDT} - {436352400 -28800 0 PST} - {452080800 -25200 1 PDT} - {467802000 -28800 0 PST} - {483530400 -25200 1 PDT} - {499251600 -28800 0 PST} - {514980000 -25200 1 PDT} - {530701200 -28800 0 PST} - {544615200 -25200 1 PDT} - {562150800 -28800 0 PST} - {576064800 -25200 1 PDT} - {594205200 -28800 0 PST} - {607514400 -25200 1 PDT} - {625654800 -28800 0 PST} - {638964000 -25200 1 PDT} - {657104400 -28800 0 PST} - {671018400 -25200 1 PDT} - {688554000 -28800 0 PST} - {702468000 -25200 1 PDT} - {720003600 -28800 0 PST} - {733917600 -25200 1 PDT} - {752058000 -28800 0 PST} - {765367200 -25200 1 PDT} - {783507600 -28800 0 PST} - {796816800 -25200 1 PDT} - {814957200 -28800 0 PST} - {820483200 -28800 0 PST} - {828871200 -25200 1 PDT} - {846406800 -28800 0 PST} - {860320800 -25200 1 PDT} - {877856400 -28800 0 PST} - {891770400 -25200 1 PDT} - {909306000 -28800 0 PST} - {923220000 -25200 1 PDT} - {941360400 -28800 0 PST} - {954669600 -25200 1 PDT} - {972810000 -28800 0 PST} - {978336000 -28800 0 PST} - {986119200 -25200 1 PDT} - {1004259600 -28800 0 PST} - {1014192000 -28800 0 PST} - {1018173600 -25200 1 PDT} - {1035709200 -28800 0 PST} - {1049623200 -25200 1 PDT} - {1067158800 -28800 0 PST} - {1081072800 -25200 1 PDT} - {1099213200 -28800 0 PST} - {1112522400 -25200 1 PDT} - {1130662800 -28800 0 PST} - {1143972000 -25200 1 PDT} - {1162112400 -28800 0 PST} - {1175421600 -25200 1 PDT} - {1193562000 -28800 0 PST} - {1207476000 -25200 1 PDT} - {1225011600 -28800 0 PST} - {1238925600 -25200 1 PDT} - {1256461200 -28800 0 PST} - {1270375200 -25200 1 PDT} - {1288515600 -28800 0 PST} - {1301824800 -25200 1 PDT} - {1319965200 -28800 0 PST} - {1333274400 -25200 1 PDT} - {1351414800 -28800 0 PST} - {1365328800 -25200 1 PDT} - {1382864400 -28800 0 PST} - {1396778400 -25200 1 PDT} - {1414314000 -28800 0 PST} - {1428228000 -25200 1 PDT} - {1445763600 -28800 0 PST} - {1459677600 -25200 1 PDT} - {1477818000 -28800 0 PST} - {1491127200 -25200 1 PDT} - {1509267600 -28800 0 PST} - {1522576800 -25200 1 PDT} - {1540717200 -28800 0 PST} - {1554631200 -25200 1 PDT} - {1572166800 -28800 0 PST} - {1586080800 -25200 1 PDT} - {1603616400 -28800 0 PST} - {1617530400 -25200 1 PDT} - {1635670800 -28800 0 PST} - {1648980000 -25200 1 PDT} - {1667120400 -28800 0 PST} - {1680429600 -25200 1 PDT} - {1698570000 -28800 0 PST} - {1712484000 -25200 1 PDT} - {1730019600 -28800 0 PST} - {1743933600 -25200 1 PDT} - {1761469200 -28800 0 PST} - {1775383200 -25200 1 PDT} - {1792918800 -28800 0 PST} - {1806832800 -25200 1 PDT} - {1824973200 -28800 0 PST} - {1838282400 -25200 1 PDT} - {1856422800 -28800 0 PST} - {1869732000 -25200 1 PDT} - {1887872400 -28800 0 PST} - {1901786400 -25200 1 PDT} - {1919322000 -28800 0 PST} - {1933236000 -25200 1 PDT} - {1950771600 -28800 0 PST} - {1964685600 -25200 1 PDT} - {1982826000 -28800 0 PST} - {1996135200 -25200 1 PDT} - {2014275600 -28800 0 PST} - {2027584800 -25200 1 PDT} - {2045725200 -28800 0 PST} - {2059034400 -25200 1 PDT} - {2077174800 -28800 0 PST} - {2091088800 -25200 1 PDT} - {2108624400 -28800 0 PST} - {2122538400 -25200 1 PDT} - {2140074000 -28800 0 PST} - {2153988000 -25200 1 PDT} - {2172128400 -28800 0 PST} - {2185437600 -25200 1 PDT} - {2203578000 -28800 0 PST} - {2216887200 -25200 1 PDT} - {2235027600 -28800 0 PST} - {2248941600 -25200 1 PDT} - {2266477200 -28800 0 PST} - {2280391200 -25200 1 PDT} - {2297926800 -28800 0 PST} - {2311840800 -25200 1 PDT} - {2329376400 -28800 0 PST} - {2343290400 -25200 1 PDT} - {2361430800 -28800 0 PST} - {2374740000 -25200 1 PDT} - {2392880400 -28800 0 PST} - {2406189600 -25200 1 PDT} - {2424330000 -28800 0 PST} - {2438244000 -25200 1 PDT} - {2455779600 -28800 0 PST} - {2469693600 -25200 1 PDT} - {2487229200 -28800 0 PST} - {2501143200 -25200 1 PDT} - {2519283600 -28800 0 PST} - {2532592800 -25200 1 PDT} - {2550733200 -28800 0 PST} - {2564042400 -25200 1 PDT} - {2582182800 -28800 0 PST} - {2596096800 -25200 1 PDT} - {2613632400 -28800 0 PST} - {2627546400 -25200 1 PDT} - {2645082000 -28800 0 PST} - {2658996000 -25200 1 PDT} - {2676531600 -28800 0 PST} - {2690445600 -25200 1 PDT} - {2708586000 -28800 0 PST} - {2721895200 -25200 1 PDT} - {2740035600 -28800 0 PST} - {2753344800 -25200 1 PDT} - {2771485200 -28800 0 PST} - {2785399200 -25200 1 PDT} - {2802934800 -28800 0 PST} - {2816848800 -25200 1 PDT} - {2834384400 -28800 0 PST} - {2848298400 -25200 1 PDT} - {2866438800 -28800 0 PST} - {2879748000 -25200 1 PDT} - {2897888400 -28800 0 PST} - {2911197600 -25200 1 PDT} - {2929338000 -28800 0 PST} - {2942647200 -25200 1 PDT} - {2960787600 -28800 0 PST} - {2974701600 -25200 1 PDT} - {2992237200 -28800 0 PST} - {3006151200 -25200 1 PDT} - {3023686800 -28800 0 PST} - {3037600800 -25200 1 PDT} - {3055741200 -28800 0 PST} - {3069050400 -25200 1 PDT} - {3087190800 -28800 0 PST} - {3100500000 -25200 1 PDT} - {3118640400 -28800 0 PST} - {3132554400 -25200 1 PDT} - {3150090000 -28800 0 PST} - {3164004000 -25200 1 PDT} - {3181539600 -28800 0 PST} - {3195453600 -25200 1 PDT} - {3212989200 -28800 0 PST} - {3226903200 -25200 1 PDT} - {3245043600 -28800 0 PST} - {3258352800 -25200 1 PDT} - {3276493200 -28800 0 PST} - {3289802400 -25200 1 PDT} - {3307942800 -28800 0 PST} - {3321856800 -25200 1 PDT} - {3339392400 -28800 0 PST} - {3353306400 -25200 1 PDT} - {3370842000 -28800 0 PST} - {3384756000 -25200 1 PDT} - {3402896400 -28800 0 PST} - {3416205600 -25200 1 PDT} - {3434346000 -28800 0 PST} - {3447655200 -25200 1 PDT} - {3465795600 -28800 0 PST} - {3479709600 -25200 1 PDT} - {3497245200 -28800 0 PST} - {3511159200 -25200 1 PDT} - {3528694800 -28800 0 PST} - {3542608800 -25200 1 PDT} - {3560144400 -28800 0 PST} - {3574058400 -25200 1 PDT} - {3592198800 -28800 0 PST} - {3605508000 -25200 1 PDT} - {3623648400 -28800 0 PST} - {3636957600 -25200 1 PDT} - {3655098000 -28800 0 PST} - {3669012000 -25200 1 PDT} - {3686547600 -28800 0 PST} - {3700461600 -25200 1 PDT} - {3717997200 -28800 0 PST} - {3731911200 -25200 1 PDT} - {3750051600 -28800 0 PST} - {3763360800 -25200 1 PDT} - {3781501200 -28800 0 PST} - {3794810400 -25200 1 PDT} - {3812950800 -28800 0 PST} - {3826260000 -25200 1 PDT} - {3844400400 -28800 0 PST} - {3858314400 -25200 1 PDT} - {3875850000 -28800 0 PST} - {3889764000 -25200 1 PDT} - {3907299600 -28800 0 PST} - {3921213600 -25200 1 PDT} - {3939354000 -28800 0 PST} - {3952663200 -25200 1 PDT} - {3970803600 -28800 0 PST} - {3984112800 -25200 1 PDT} - {4002253200 -28800 0 PST} - {4016167200 -25200 1 PDT} - {4033702800 -28800 0 PST} - {4047616800 -25200 1 PDT} - {4065152400 -28800 0 PST} - {4079066400 -25200 1 PDT} - {4096602000 -28800 0 PST} +if {![info exists TZData(America/Tijuana)]} { + LoadTimeZoneFile America/Tijuana } +set TZData(:America/Santa_Isabel) $TZData(:America/Tijuana) diff --git a/library/tzdata/Asia/Chita b/library/tzdata/Asia/Chita index eabce7f..6aef523 100644 --- a/library/tzdata/Asia/Chita +++ b/library/tzdata/Asia/Chita @@ -68,4 +68,5 @@ set TZData(:Asia/Chita) { {1288458000 32400 0 YAKT} {1301158800 36000 0 YAKT} {1414252800 28800 0 IRKT} + {1459015200 32400 0 YAKT} } diff --git a/library/tzdata/Asia/Karachi b/library/tzdata/Asia/Karachi index 3faa31e..669c11a 100644 --- a/library/tzdata/Asia/Karachi +++ b/library/tzdata/Asia/Karachi @@ -7,8 +7,8 @@ set TZData(:Asia/Karachi) { {-764145000 19800 0 IST} {-576135000 18000 0 KART} {38775600 18000 0 PKT} - {1018119660 21600 1 PKST} - {1033840860 18000 0 PKT} + {1018119600 21600 1 PKST} + {1033840800 18000 0 PKT} {1212260400 21600 1 PKST} {1225476000 18000 0 PKT} {1239735600 21600 1 PKST} diff --git a/library/tzdata/Asia/Tehran b/library/tzdata/Asia/Tehran index 7dca0ae..5fd840d 100644 --- a/library/tzdata/Asia/Tehran +++ b/library/tzdata/Asia/Tehran @@ -102,4 +102,128 @@ set TZData(:Asia/Tehran) { {2105551800 12600 0 IRST} {2121193800 16200 1 IRDT} {2137087800 12600 0 IRST} + {2152729800 16200 1 IRDT} + {2168623800 12600 0 IRST} + {2184265800 16200 1 IRDT} + {2200159800 12600 0 IRST} + {2215888200 16200 1 IRDT} + {2231782200 12600 0 IRST} + {2247424200 16200 1 IRDT} + {2263318200 12600 0 IRST} + {2278960200 16200 1 IRDT} + {2294854200 12600 0 IRST} + {2310496200 16200 1 IRDT} + {2326390200 12600 0 IRST} + {2342118600 16200 1 IRDT} + {2358012600 12600 0 IRST} + {2373654600 16200 1 IRDT} + {2389548600 12600 0 IRST} + {2405190600 16200 1 IRDT} + {2421084600 12600 0 IRST} + {2436726600 16200 1 IRDT} + {2452620600 12600 0 IRST} + {2468349000 16200 1 IRDT} + {2484243000 12600 0 IRST} + {2499885000 16200 1 IRDT} + {2515779000 12600 0 IRST} + {2531421000 16200 1 IRDT} + {2547315000 12600 0 IRST} + {2562957000 16200 1 IRDT} + {2578851000 12600 0 IRST} + {2594579400 16200 1 IRDT} + {2610473400 12600 0 IRST} + {2626115400 16200 1 IRDT} + {2642009400 12600 0 IRST} + {2657651400 16200 1 IRDT} + {2673545400 12600 0 IRST} + {2689187400 16200 1 IRDT} + {2705081400 12600 0 IRST} + {2720809800 16200 1 IRDT} + {2736703800 12600 0 IRST} + {2752345800 16200 1 IRDT} + {2768239800 12600 0 IRST} + {2783881800 16200 1 IRDT} + {2799775800 12600 0 IRST} + {2815417800 16200 1 IRDT} + {2831311800 12600 0 IRST} + {2847040200 16200 1 IRDT} + {2862934200 12600 0 IRST} + {2878576200 16200 1 IRDT} + {2894470200 12600 0 IRST} + {2910112200 16200 1 IRDT} + {2926006200 12600 0 IRST} + {2941648200 16200 1 IRDT} + {2957542200 12600 0 IRST} + {2973270600 16200 1 IRDT} + {2989164600 12600 0 IRST} + {3004806600 16200 1 IRDT} + {3020700600 12600 0 IRST} + {3036342600 16200 1 IRDT} + {3052236600 12600 0 IRST} + {3067878600 16200 1 IRDT} + {3083772600 12600 0 IRST} + {3099501000 16200 1 IRDT} + {3115395000 12600 0 IRST} + {3131037000 16200 1 IRDT} + {3146931000 12600 0 IRST} + {3162573000 16200 1 IRDT} + {3178467000 12600 0 IRST} + {3194109000 16200 1 IRDT} + {3210003000 12600 0 IRST} + {3225731400 16200 1 IRDT} + {3241625400 12600 0 IRST} + {3257267400 16200 1 IRDT} + {3273161400 12600 0 IRST} + {3288803400 16200 1 IRDT} + {3304697400 12600 0 IRST} + {3320339400 16200 1 IRDT} + {3336233400 12600 0 IRST} + {3351961800 16200 1 IRDT} + {3367855800 12600 0 IRST} + {3383497800 16200 1 IRDT} + {3399391800 12600 0 IRST} + {3415033800 16200 1 IRDT} + {3430927800 12600 0 IRST} + {3446569800 16200 1 IRDT} + {3462463800 12600 0 IRST} + {3478192200 16200 1 IRDT} + {3494086200 12600 0 IRST} + {3509728200 16200 1 IRDT} + {3525622200 12600 0 IRST} + {3541264200 16200 1 IRDT} + {3557158200 12600 0 IRST} + {3572800200 16200 1 IRDT} + {3588694200 12600 0 IRST} + {3604422600 16200 1 IRDT} + {3620316600 12600 0 IRST} + {3635958600 16200 1 IRDT} + {3651852600 12600 0 IRST} + {3667494600 16200 1 IRDT} + {3683388600 12600 0 IRST} + {3699030600 16200 1 IRDT} + {3714924600 12600 0 IRST} + {3730653000 16200 1 IRDT} + {3746547000 12600 0 IRST} + {3762189000 16200 1 IRDT} + {3778083000 12600 0 IRST} + {3793725000 16200 1 IRDT} + {3809619000 12600 0 IRST} + {3825261000 16200 1 IRDT} + {3841155000 12600 0 IRST} + {3856883400 16200 1 IRDT} + {3872777400 12600 0 IRST} + {3888419400 16200 1 IRDT} + {3904313400 12600 0 IRST} + {3919955400 16200 1 IRDT} + {3935849400 12600 0 IRST} + {3951491400 16200 1 IRDT} + {3967385400 12600 0 IRST} + {3983113800 16200 1 IRDT} + {3999007800 12600 0 IRST} + {4014649800 16200 1 IRDT} + {4030543800 12600 0 IRST} + {4046185800 16200 1 IRDT} + {4062079800 12600 0 IRST} + {4077721800 16200 1 IRDT} + {4093615800 12600 0 IRST} } -- cgit v0.12 From 3a234ba343433d741a7a0c873702da6cb7987ae5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 19 Feb 2016 14:42:53 +0000 Subject: Add test-case which demonstrates the problem. This test-case fails in trunk (but passes in core-8-5-branch, as expected). --- tests/env.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/env.test b/tests/env.test index 83d99e0..f9df4d6 100644 --- a/tests/env.test +++ b/tests/env.test @@ -314,6 +314,19 @@ test env-7.2 {[219226]: links to env elements should not be removed by read} { }} } ok +test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy trace} { + apply {{} { + catch {unset ::env(test7_3)} + proc foo args { + set ::env(test7_3) ok + } + trace add variable ::env(not_yet_existent) write foo + info exists ::env(not_yet_existent) + set ::env(not_yet_existent) "Now I'm here"; + info exists ::env(test7_3) + }} +} 1 + # Restore the environment variables at the end of the test. foreach name [array names env] { -- cgit v0.12 From 22d2441089751ab75a5d01ceb99f5fa3f21b1356 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 19 Feb 2016 16:44:26 +0000 Subject: Bump to TclOO 1.0.4. Update changes file. --- changes | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ generic/tclOO.h | 2 +- unix/tclooConfig.sh | 2 +- win/tclooConfig.sh | 2 +- 4 files changed, 93 insertions(+), 3 deletions(-) diff --git a/changes b/changes index 2084f80..557c8c6 100644 --- a/changes +++ b/changes @@ -8529,6 +8529,96 @@ include ::oo::class (fellows) --- Released 8.6.4, March 12, 2015 --- http://core.tcl.tk/tcl/ for details +2015-03-19 (bug)[e66e44] Win: Ctrl-C/Ctrl-Break in console not EOF (nadkarni) + +2015-03-21 (bug)[d87cb1] Proper tailcall from compiled ensembles (sofer) + +2015-04-23 (bug)[19ea02] Win: shared read from linked dirs (bogdan,oehhar) + +2015-04-24 (bug)[879a07] Incomplete chars @ buffer ends (leunissen,porter) + +2015-04-29 (bug)[894da1] Hang flushing blocking channels (yorick) + +2015-05-14 (enhance)[b9d043] Default use of gzip transfer encoding (fellows) +=> http 2.8.9 + *** POTENTIAL INCOMPATIBILITY *** + +2015-05-15 (bug)[9dd1bd] destructor [self] after failed constructor (calvo,fellows) + +2015-05-15 (bug)[0f42ff] [tailcall] combined with [next] (aspect,fellows) + +2015-05-18 (bug)[c11a51] http: race condition in -accept option (fellows) + +2015-05-19 (enhance) More pure lists from compiled [list] (porter,fellows) + +2015-05-27 (enhancement) Relax memdebug constraint on extensions (kupries) + +2015-06-03 (bug)[268b23] crash in traced [expr] (execute-11.2)(tomkinson,porter) + +2015-06-11 (bug)[478c44] Memleak in zlib compresion errors (mistachkin) + +2015-06-16 (bug)[e770d9] Higher baud on serial channels (woods,nijtmans) + +2015-06-18 (update) Update Unicode data to 8.0 (nijtmans) + *** POTENTIAL INCOMPATIBILITY *** + +2015-06-18 (bug)[a4cb3f] compiled [lreplace] handling of end (bron,aspect) + +2015-06-23 (enhance) Use Unicode SendMessageTimeout() (nijtmans) +=> registry 1.3.1 + 2015-06-25 (TIP 412) msgcat dynamic locale change and package private locale (oehlmann) => msgcat 1.6.0 +2015-07-05 (bug)[a0ece9] crash in traced [expr] (execute-11.3) (hans,porter) + +2015-07-10 (TIP 436) [info object isa] favors 'false' over error (fellows) +=> TclOO 1.0.4 + +2015-07-15 (bug)[b1534b][9bad63] writes beyond buffer bounds (hanno,porter) + +2015-07-18 (bug)[a3309d] Memleak in compiled [unset a($i)] (jeff,porter) + +2015-07-23 (bug)[57945b] lock in forking/multi-threading (neumann,mistachkin) + +2015-07-29 (bug)[3e7eca] Allocation overflow in expr parsing (rickyb,porter) + +2015-07-30 (bug)[f00009] Win: Memleak in [file] (rp,sebres) + +2015-07-31 (bug) Correct problems found in Coverity audit (sofer) + +2015-08-19 (bug)[00189c] MSVC 14: semi-static UCRT support (dower,nijtmans) + +2015-08-26 (bug)[0df7a1] Tolerate getcwd() failures (cato,nijtmans) + +2015-09-21 (bug)[1115587][a3c350][d7ea9f][0e0e15][187d7f] Many fixes and +improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) + +2015-09-23 (enhance) hash lookup microoptimization (hipp) + +2015-09-23 (bug)[e0a7b3] Input buffer draining & file events (griffin,porter) + +2015-09-29 (bug)[219866] Cygwin support error (yorick,nijtmans) +=> platform 1.0.14 + +2015-10-06 (bug)[b42a85] Win: [file normalize ~user] wrong dir (nadkarni) + +2015-10-21 (bug)[1080042][8f2450] More regexp from Postgres (lane,porter) + +2015-10-23 (bug)[4a0c16] [clock] react to msgcat locale change (oehlmann) + +2015-11-10 (bug)[261a8a] Overflow segfault in I/O translation (brooks,porter) + +2015-11-20 (bug)[40f628] ListObjReplace callers fail to detect max (porter) + +2015-11-30 (enhance)[32c574] Improve list growth performance (brooks,porter) + +2015-12-11 (bug)[c9eb6b] tolerate unset ::env(TZ) (gahr, nijtmans) + +2016-01-29 (TIP 440) tcl_platform(engine) -- Tcl implementation (mistachkin) + +2016-02-03 (bug)[25842c] stream [zlib deflate] fails with 0 input (ade,fellows) + +2016-02-04 (bug)[3d96b7][593baa][cf74de] crashes in OO teardown (porter,fellows) + +--- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tcl/ for details diff --git a/generic/tclOO.h b/generic/tclOO.h index a7116dc..696908a 100644 --- a/generic/tclOO.h +++ b/generic/tclOO.h @@ -24,7 +24,7 @@ * win/tclooConfig.sh */ -#define TCLOO_VERSION "1.0.3" +#define TCLOO_VERSION "1.0.4" #define TCLOO_PATCHLEVEL TCLOO_VERSION #include "tcl.h" diff --git a/unix/tclooConfig.sh b/unix/tclooConfig.sh index 55fe75f..ee10b81 100644 --- a/unix/tclooConfig.sh +++ b/unix/tclooConfig.sh @@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS="" -TCLOO_VERSION=1.0.3 +TCLOO_VERSION=1.0.4 diff --git a/win/tclooConfig.sh b/win/tclooConfig.sh index 55fe75f..ee10b81 100644 --- a/win/tclooConfig.sh +++ b/win/tclooConfig.sh @@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS="" -TCLOO_VERSION=1.0.3 +TCLOO_VERSION=1.0.4 -- cgit v0.12 From 96f8fc81311574307013ca7a6f4abc589600d848 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 22 Feb 2016 12:39:10 +0000 Subject: Convert remaining env.test test-cases to tcltest-2 format --- tests/env.test | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/tests/env.test b/tests/env.test index f9df4d6..9f59fbc 100644 --- a/tests/env.test +++ b/tests/env.test @@ -278,20 +278,20 @@ test env-5.4 {corner cases - unset the env array} -setup { } -cleanup { interp delete i } -result {1 a 1} -test env-5.5 {corner cases - cannot have null entries on Windows} {win} { +test env-5.5 {corner cases - cannot have null entries on Windows} -constraints win -body { set env() a catch {set env()} -} {1} +} -result 1 -test env-6.1 {corner cases - add lots of env variables} {} { +test env-6.1 {corner cases - add lots of env variables} -body { set size [array size env] for {set i 0} {$i < 100} {incr i} { set env(BOGUS$i) $i } expr {[array size env] - $size} -} 100 +} -result 100 -test env-7.1 {[219226]: whole env array should not be unset by read} { +test env-7.1 {[219226]: whole env array should not be unset by read} -body { set n [array size env] set s [array startsearch env] while {[array anymore env $s]} { @@ -300,21 +300,18 @@ test env-7.1 {[219226]: whole env array should not be unset by read} { } array donesearch env $s return $n -} 0 -test env-7.2 {[219226]: links to env elements should not be removed by read} { +} -result 0 + +test env-7.2 {[219226]: links to env elements should not be removed by read} -body { apply {{} { set ::env(test7_2) ok upvar env(test7_2) elem set ::env(PATH) - try { - return $elem - } finally { - unset ::env(test7_2) - } + return $elem }} -} ok +} -result ok -test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy trace} { +test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy trace} -body { apply {{} { catch {unset ::env(test7_3)} proc foo args { @@ -323,9 +320,9 @@ test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy trace add variable ::env(not_yet_existent) write foo info exists ::env(not_yet_existent) set ::env(not_yet_existent) "Now I'm here"; - info exists ::env(test7_3) + return [info exists ::env(test7_3)] }} -} 1 +} -result 1 # Restore the environment variables at the end of the test. -- cgit v0.12 From be11bbf1dc6b1ef1beba522c31bd9a69fbd625db Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 23 Feb 2016 14:02:20 +0000 Subject: update changes --- changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changes b/changes index 557c8c6..1e24269 100644 --- a/changes +++ b/changes @@ -8621,4 +8621,6 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2016-02-04 (bug)[3d96b7][593baa][cf74de] crashes in OO teardown (porter,fellows) +2016-02-22 (bug)[9b4702] [info exists env(missing)] kills trace (nijtmans) + --- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tcl/ for details -- cgit v0.12 From 76d76990cd84bb8e025ce8b4453ccd605a929743 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 26 Feb 2016 16:17:12 +0000 Subject: Clean up unfired timer handlers or they cause errors in -singleproc 1 test run. --- tests/msgcat.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/msgcat.test b/tests/msgcat.test index 6b965d1..8647f9c 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -995,6 +995,7 @@ namespace eval ::msgcat::test { mcloadedlocales clear } -cleanup { mcforgetpackage + after cancel set [namespace current]::resultvariable timeout } -body { mcpackageconfig set loadcmd [namespace code callbackfailproc] mclocale foo_bar -- cgit v0.12