summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-22 18:13:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-22 18:13:43 (GMT)
commitaeecfffbb1e7b3fab3850fc7d0baca8b3239db5e (patch)
tree13dcf779d10f0ebd105945d8948fcabe9de8aebd /generic/tclAssembly.c
parent712675a74471cd7bac4f09430c1df7e6a1585e9a (diff)
parenta52a0147b7b9491e17b69cda754de7fe2476540f (diff)
downloadtcl-aeecfffbb1e7b3fab3850fc7d0baca8b3239db5e.zip
tcl-aeecfffbb1e7b3fab3850fc7d0baca8b3239db5e.tar.gz
tcl-aeecfffbb1e7b3fab3850fc7d0baca8b3239db5e.tar.bz2
merge trunk
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r--generic/tclAssembly.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 6d5676b..3928956 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -269,15 +269,12 @@ static void CompileEmbeddedScript(AssemblyEnv*, Tcl_Token*,
const TalInstDesc*);
static int DefineLabel(AssemblyEnv* envPtr, const char* label);
static void DeleteMirrorJumpTable(JumptableInfo* jtPtr);
-static void DupAssembleCodeInternalRep(Tcl_Obj* src,
- Tcl_Obj* dest);
static void FillInJumpOffsets(AssemblyEnv*);
static int CreateMirrorJumpTable(AssemblyEnv* assemEnvPtr,
Tcl_Obj* jumpTable);
static int FindLocalVar(AssemblyEnv* envPtr,
Tcl_Token** tokenPtrPtr);
static int FinishAssembly(AssemblyEnv*);
-static void FreeAssembleCodeInternalRep(Tcl_Obj *objPtr);
static void FreeAssemblyEnv(AssemblyEnv*);
static int GetBooleanOperand(AssemblyEnv*, Tcl_Token**, int*);
static int GetListIndexOperand(AssemblyEnv*, Tcl_Token**, int*);
@@ -316,6 +313,9 @@ static void UnstackExpiredCatches(CompileEnv*, BasicBlock*, int,
* Tcl_ObjType that describes bytecode emitted by the assembler.
*/
+static Tcl_FreeInternalRepProc FreeAssembleCodeInternalRep;
+static Tcl_DupInternalRepProc DupAssembleCodeInternalRep;
+
static const Tcl_ObjType assembleCodeType = {
"assemblecode",
FreeAssembleCodeInternalRep, /* freeIntRepProc */
@@ -866,7 +866,7 @@ CompileAssembleObj(
* Not valid, so free it and regenerate.
*/
- FreeAssembleCodeInternalRep(objPtr);
+ TclFreeIntRep(objPtr);
}
/*
@@ -4311,13 +4311,12 @@ static void
FreeAssembleCodeInternalRep(
Tcl_Obj *objPtr)
{
- ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
+ ByteCode *codePtr = NULL;
- codePtr->refCount--;
- if (codePtr->refCount <= 0) {
- TclCleanupByteCode(codePtr);
- }
- objPtr->typePtr = NULL;
+ ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr);
+ assert(codePtr != NULL);
+
+ TclReleaseByteCode(codePtr);
}
/*