Index: generic/nsf.c =================================================================== diff -u -N -re157ce6c9468e2a9fe01b45d1547f0a0e20e3e8a -r9d4daad15fb78a543a8b73b91818b44a21f0ea24 --- generic/nsf.c (.../nsf.c) (revision e157ce6c9468e2a9fe01b45d1547f0a0e20e3e8a) +++ generic/nsf.c (.../nsf.c) (revision 9d4daad15fb78a543a8b73b91818b44a21f0ea24) @@ -220,7 +220,8 @@ *Nsf_OT_intType = NULL, *Nsf_OT_parsedVarNameType = NULL, *Nsf_OT_byteArrayType = NULL, - *Nsf_OT_properByteArrayType = NULL; + *Nsf_OT_properByteArrayType = NULL, + *Nsf_OT_bignumType = NULL; /* * Function prototypes @@ -16689,7 +16690,7 @@ * Try to short_cut common cases to avoid conversion to bignums, since * Tcl_GetBignumFromObj returns a value, which has to be freed. */ - if (objPtr->typePtr == Nsf_OT_intType) { + if (objPtr->typePtr == Nsf_OT_intType || objPtr->typePtr == Nsf_OT_bignumType) { /* * We know already that the value is an int */ @@ -35545,6 +35546,15 @@ Nsf_OT_byteArrayType = Tcl_GetObjType("bytearray"); assert(Nsf_OT_byteArrayType != NULL); + { mp_int bignumValue; + + tmpObj = Tcl_NewStringObj("10000000000000000000000", -1); + Tcl_GetBignumFromObj(NULL, tmpObj, &bignumValue); + Nsf_OT_bignumType = tmpObj->typePtr; + assert(Nsf_OT_bignumType != NULL); + Tcl_DecrRefCount(tmpObj); + } + /* * Get bytearray and proper bytearray from Tcl (latter if available, * introduced in Tcl 8.7a+)