From daebde9815505a26c673a6c966df7fab99e122a5 Mon Sep 17 00:00:00 2001 From: gahr Date: Fri, 28 Apr 2017 11:15:08 +0000 Subject: Make sure not to miss bignums --- generic/tclExecute.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 04f0232..908cabd 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -519,10 +519,12 @@ VarHashCreateVar( ((objPtr)->typePtr == &tclIntType) \ ? (*(tPtr) = TCL_NUMBER_LONG, \ *(ptrPtr) = (ClientData) \ - (&((objPtr)->internalRep.longValue))) : \ - (*(tPtr) = TCL_NUMBER_DOUBLE, \ + (&((objPtr)->internalRep.longValue)), TCL_OK) : \ + ((objPtr)->typePtr == &tclDoubleType) \ + ? (*(tPtr) = TCL_NUMBER_DOUBLE, \ *(ptrPtr) = (ClientData) \ - (&((objPtr)->internalRep.doubleValue))) + (&((objPtr)->internalRep.doubleValue)), TCL_OK) : \ + TclGetNumberFromObj(NULL, (objPtr), (ptrPtr), (tPtr)) #else /* !TCL_WIDE_INT_IS_LONG */ #define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \ (((objPtr)->typePtr == &tclIntType) \ @@ -546,14 +548,16 @@ VarHashCreateVar( ((objPtr)->typePtr == &tclIntType) \ ? (*(tPtr) = TCL_NUMBER_LONG, \ *(ptrPtr) = (ClientData) \ - (&((objPtr)->internalRep.longValue))) : \ + (&((objPtr)->internalRep.longValue)), TCL_OK) : \ ((objPtr)->typePtr == &tclWideIntType) \ ? (*(tPtr) = TCL_NUMBER_WIDE, \ *(ptrPtr) = (ClientData) \ - (&((objPtr)->internalRep.wideValue))) : \ - (*(tPtr) = TCL_NUMBER_DOUBLE, \ + (&((objPtr)->internalRep.wideValue)), TCL_OK) : \ + ((objPtr)->typePtr == &tclDoubleType) \ + ? (*(tPtr) = TCL_NUMBER_DOUBLE, \ *(ptrPtr) = (ClientData) \ - (&((objPtr)->internalRep.doubleValue))) + (&((objPtr)->internalRep.doubleValue)), TCL_OK) : \ + TclGetNumberFromObj(NULL, (objPtr), (ptrPtr), (tPtr)) #endif /* TCL_WIDE_INT_IS_LONG */ /* -- cgit v0.12