summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-09-11 14:51:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-09-11 14:51:30 (GMT)
commitbb0e1b3afc472809c26cd4239fd2b4b71c829eda (patch)
treec14ae0d9eca19404b8d87449019fce33010323b0 /generic
parent1f2dbd38f566c8e4f63bec06139aabe9e20dc371 (diff)
downloadtcl-bb0e1b3afc472809c26cd4239fd2b4b71c829eda.zip
tcl-bb0e1b3afc472809c26cd4239fd2b4b71c829eda.tar.gz
tcl-bb0e1b3afc472809c26cd4239fd2b4b71c829eda.tar.bz2
Fixes to Tcl_StoreIntRep -- support irPtr == NULL
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c5
-rw-r--r--generic/tclObj.c12
2 files changed, 9 insertions, 8 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index e5b09b8..5a33445 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -6141,10 +6141,7 @@ TclNREvalObjEx(
iPtr->varFramePtr = iPtr->rootFramePtr;
}
Tcl_IncrRefCount(objPtr);
- ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
- if (codePtr == NULL) {
- codePtr = TclCompileObj(interp, objPtr, invoker, word);
- }
+ codePtr = TclCompileObj(interp, objPtr, invoker, word);
TclNRAddCallback(interp, TEOEx_ByteCodeCallback, savedVarFramePtr,
objPtr, INT2PTR(allowExceptions), NULL);
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 9ea55e7..dc90b44 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -1997,16 +1997,20 @@ Tcl_StoreIntRep(
if (objPtr->typePtr == NULL) {
/* Special case - updating (or clearing) a pure string object */
- TclFreeIntRep(objPtr);
- objPtr->internalRep = *irPtr;
- objPtr->typePtr = typePtr;
+ if (irPtr) {
+ objPtr->internalRep = *irPtr;
+ objPtr->typePtr = typePtr;
+ }
return;
}
if (objPtr->typePtr == typePtr) {
/* Special case - updating (or clearing) an objects existing intrep */
TclFreeIntRep(objPtr);
- objPtr->internalRep = *irPtr;
+ if (irPtr) {
+ objPtr->internalRep = *irPtr;
+ objPtr->typePtr = typePtr;
+ }
return;
}