diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-04 12:53:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-04 12:53:45 (GMT) |
commit | af320fb41e62980c0c988a377c138ac14757ad81 (patch) | |
tree | 3ad18294ff5f98a7dbf12f0752e6dbdfeaaba7ae | |
parent | b583ea7360808cb502d1ea65954ab0387ebdd823 (diff) | |
download | tcl-af320fb41e62980c0c988a377c138ac14757ad81.zip tcl-af320fb41e62980c0c988a377c138ac14757ad81.tar.gz tcl-af320fb41e62980c0c988a377c138ac14757ad81.tar.bz2 |
Fix [9c397da4a9]: AppendPrintfToObjVA(): support 64-bit pointers
-rw-r--r-- | generic/tcl.h | 2 | ||||
-rw-r--r-- | generic/tclStringObj.c | 8 | ||||
-rw-r--r-- | generic/tclStringRep.h | 2 | ||||
-rw-r--r-- | tests/tailcall.test | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 318c7a1..2b6c947 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2176,7 +2176,7 @@ typedef struct Tcl_EncodingType { #define TCL_ENCODING_CHAR_LIMIT 0x10 /* Internal use bits, do not define bits in this space. See above comment */ #define TCL_ENCODING_INTERNAL_USE_MASK 0xFF00 -/* +/* * Reserve top byte for profile values (disjoint, not a mask). In case of * changes, ensure ENCODING_PROFILE_* macros in tclInt.h are modified if * necessary. diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 7fbf77a..0e47487 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -249,7 +249,7 @@ UpdateStringOfUTF16String( #endif #endif - + /* * TCL STRING GROWTH ALGORITHM * @@ -3130,12 +3130,16 @@ AppendPrintfToObjVA( break; } + case 'p': + if (sizeof(size_t) == sizeof(Tcl_WideInt)) { + size = 2; + } + /* FALLTHRU */ case 'c': case 'i': case 'u': case 'd': case 'o': - case 'p': case 'x': case 'X': seekingConversion = 0; diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h index ef64d6c..d1863fb 100644 --- a/generic/tclStringRep.h +++ b/generic/tclStringRep.h @@ -22,7 +22,7 @@ /* * The following structure is the internal rep for a String object. It keeps * track of how much memory has been used and how much has been allocated for - * the various representations to enable growing and shrinking of + * the various representations to enable growing and shrinking of * the String object with fewer mallocs. To optimize string * length and indexing operations, this structure also stores the number of * code points (independent of encoding form) once that value has been computed. diff --git a/tests/tailcall.test b/tests/tailcall.test index c9ec674..0016845 100644 --- a/tests/tailcall.test +++ b/tests/tailcall.test @@ -709,7 +709,7 @@ test tailcall-14.1-bc {{in a deleted namespace} {byte compiled}} -body { } -returnCodes 1 -result {namespace "::ns" not found} test tailcall-bug-784befb0ba {tailcall crash with 254 args} -body { - proc tccrash args {llength $args} + proc tccrash args {llength $args} # Must be EXACTLY 254 for crash proc p {} [list tailcall tccrash {*}[lrepeat 254 x]] p |