summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-29 19:29:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-29 19:29:14 (GMT)
commitd41d08e1111a2353e98c6814043b6441e6e71b64 (patch)
treeafd15372be814df73b18bb4c139fee4cc1de2be2 /generic/tclCompile.c
parent100542f06740e0120d51ef844f61d47b10ce39ef (diff)
downloadtcl-d41d08e1111a2353e98c6814043b6441e6e71b64.zip
tcl-d41d08e1111a2353e98c6814043b6441e6e71b64.tar.gz
tcl-d41d08e1111a2353e98c6814043b6441e6e71b64.tar.bz2
Parameterize TclInitByteCodeObj to callers sense of typePtr.dgp_init_bytecode
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 32a09b2..96b418c 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -868,7 +868,7 @@ TclSetByteCodeFromAny(
#endif /*TCL_COMPILE_DEBUG*/
if (result == TCL_OK) {
- TclInitByteCodeObj(objPtr, &compEnv);
+ (void) TclInitByteCodeObj(objPtr, &tclByteCodeType, &compEnv);
#ifdef TCL_COMPILE_DEBUG
if (tclTraceCompile >= 2) {
TclPrintByteCodeObj(interp, objPtr);
@@ -1322,11 +1322,9 @@ CompileSubstObj(
TclSubstCompile(interp, bytes, numBytes, flags, 1, &compEnv);
TclEmitOpcode(INST_DONE, &compEnv);
- TclInitByteCodeObj(objPtr, &compEnv);
- objPtr->typePtr = &substCodeType;
+ codePtr = TclInitByteCodeObj(objPtr, &substCodeType, &compEnv);
TclFreeCompileEnv(&compEnv);
- codePtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->internalRep.twoPtrValue.ptr1 = codePtr;
objPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(flags);
if (iPtr->varFramePtr->localCachePtr) {
@@ -2879,11 +2877,12 @@ TclInitByteCode(
return codePtr;
}
-void
+ByteCode *
TclInitByteCodeObj(
Tcl_Obj *objPtr, /* Points object that should be initialized,
* and whose string rep contains the source
* code. */
+ const Tcl_ObjType *typePtr,
register CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
@@ -2900,7 +2899,8 @@ TclInitByteCodeObj(
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = codePtr;
- objPtr->typePtr = &tclByteCodeType;
+ objPtr->typePtr = typePtr;
+ return codePtr;
}
/*