diff options
author | dgp <dgp@users.sourceforge.net> | 2016-03-25 20:01:39 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-03-25 20:01:39 (GMT) |
commit | 799e58d2cefd7d8c99413cde4397a1cfa3a5c817 (patch) | |
tree | b76c3bba8e911c7f1258437ffe3f91b8ef6c5f45 | |
parent | 8cef530f278a768728a688be6a46e02060b829f2 (diff) | |
download | tcl-799e58d2cefd7d8c99413cde4397a1cfa3a5c817.zip tcl-799e58d2cefd7d8c99413cde4397a1cfa3a5c817.tar.gz tcl-799e58d2cefd7d8c99413cde4397a1cfa3a5c817.tar.bz2 |
irPtr = NULL passed to Tcl_StoreIntRep clears out any value for typePtr.
-rw-r--r-- | generic/tclObj.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index 3341fcd..7db9ff9 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -1840,11 +1840,14 @@ Tcl_StoreIntRep( /* Clear out any existing IntRep ( "shimmer" ) */ TclFreeIntRep(objPtr); - /* Copy the new IntRep into place */ - objPtr->internalRep = *irPtr; + /* When irPtr == NULL, just leave objPtr with no IntRep for typePtr */ + if (irPtr) { + /* Copy the new IntRep into place */ + objPtr->internalRep = *irPtr; - /* Set the type to match */ - objPtr->typePtr = typePtr; + /* Set the type to match */ + objPtr->typePtr = typePtr; + } } /* |