Subject: Make sure not to miss bignums

From: gahr <[email-masked]>
Date: Fri, 28 Apr 2017 11:15:08 +0000

---
 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