From ca4e244cca3e93fb8689fe1cef85954da16ff989 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Wed, 25 Jan 2023 02:52:24 +0000 Subject: Test TableFromUtfProc() with strict handling of encoding errors. --- generic/tclEncoding.c | 2 +- tests/encoding.test | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index d10d9ca..5ba7763 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -3199,7 +3199,7 @@ TableFromUtfProc( word = fromUnicode[(ch >> 8)][ch & 0xFF]; if ((word == 0) && (ch != 0)) { - if ((STOPONERROR) && (flags & TCL_ENCODING_CHAR_LIMIT)) { + if ((STOPONERROR)) { result = TCL_CONVERT_UNKNOWN; break; } diff --git a/tests/encoding.test b/tests/encoding.test index a1d129e..d9382e4 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -513,8 +513,11 @@ test encoding-17.10 {Utf32ToUtfProc} -body { encoding convertfrom -nocomplain utf-32 "\xFF\xFF\xFF\xFF" } -result \uFFFD -test encoding-18.1 {TableToUtfProc} { -} {} + +test encoding-18.1 {TableToUtfProc error on invalid input with -strict} -body { + list [catch {encoding convertto -strict jis0208 \\} res] $res +} -result {1 {unexpected character at index 0: 'U+00005C'}} + test encoding-19.1 {TableFromUtfProc} { } {} @@ -915,6 +918,7 @@ test encoding-29.0 {get encoding nul terminator lengths} -constraints { [testencoding nullength ksc5601] } -result {1 2 4 2 2} + # cleanup namespace delete ::tcl::test::encoding ::tcltest::cleanupTests -- cgit v0.12 From d271c9f407a60528785465284451c752639b1128 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Thu, 26 Jan 2023 23:55:30 +0000 Subject: Fix for [ee08ed090b0a5408], sporadic segmentation fault in coroutine.test/coroutine-7.4. --- generic/tclBasic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 80dc416..bea5996 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -10520,6 +10520,7 @@ TclNRCoroutineObjCmd( corPtr->running.lineLABCPtr = corPtr->lineLABCPtr; corPtr->stackLevel = NULL; corPtr->auxNumLevels = 0; + corPtr->yieldPtr = NULL; /* * Create the coro's execEnv, switch to it to push the exit and coro -- cgit v0.12