|
2019-01-07
| ||
| 01:47 | • Closed ticket [b8da19fd16]: bad stack depth computations: is 0, should be 1 ... artifact: 30b6a3e67a user: sebres | |
|
2018-12-04
| ||
| 12:09 | • Pending ticket [b8da19fd16]. artifact: 7c3d9482b0 user: sebres | |
| 09:25 | • New ticket [b8da19fd16]. artifact: 501095e3b0 user: anonymous29 | |
bad stack depth computations: is 0, should be 1
Hi,
Getting error during TCL upgrade from 8.4 to 8.6
We had added few New mathematics operator in TCL8.4 and working fine.
But now i am porting TCL to 8.6 and getting "bad stack depth computations: is 0, should be 1" error.
If modify "tclInstructionTable" value field as mention below. it working fine.
in TCL porting to 8.4 used
{"error", 0, 0, 0, {OPERAND_NONE}},
in TCL porting to 8.6
{"error", 1, 0, 0, {OPERAND_NONE}},
We have to use "1" instead of "0" as Bytes filed.. WHY ?
also what type of modification required for other filed value ?
Is there any document for "tclInstructionTable"? if yes please share
I am looking forward to hearing from you
Thanks
> We have to use "1" instead of "0" as Bytes filed.. WHY ?
Because the byte of the instruction-command self is counted also, numBytes equals all bytes reserved for a command in byte-code (including command instruction and operand bytes also). Thus all single-byte instructions have numBytes = 1.
> Is there any document for "tclInstructionTable"? if yes please share
For example take a look in tclCompile.h and declaration of InstructionDesc type.
Also note that 8.6 has additional handling round about byte-code/instructions compilation process: byte-code and compaction optimizations (see tclOptimize.c/tclCompile.c), command search (emit of instruction relative INST_START_CMD), capturing the inner context (e. g. call stack in error case) as well as disassembling of the byte-code, etc.
Because byte-code compilation is merely an internal API, the source code will be your best friend there.
Also note that some instructions may be a bit incompatible between 8.4 and 8.6. To have some obsolete instructions (like INST_CALL_BUILTIN_FUNC1, INST_CALL_FUNC1) you must also compile Tcl using directive TCL_SUPPORT_84_BYTECODE=1.
closed for no activity (as pure upgrade issue).