diff options
author | mig <mig@noemail.net> | 2013-12-23 11:28:12 (GMT) |
---|---|---|
committer | mig <mig@noemail.net> | 2013-12-23 11:28:12 (GMT) |
commit | 26ac7a1630fdd3773756193d5d558190c13ae05e (patch) | |
tree | a87689cbd43415d9ec6e609818b8d61939844ced /generic/tclCompile.h | |
parent | 10527669f64c7284155f7775dede925229921d66 (diff) | |
download | tcl-26ac7a1630fdd3773756193d5d558190c13ae05e.zip tcl-26ac7a1630fdd3773756193d5d558190c13ae05e.tar.gz tcl-26ac7a1630fdd3773756193d5d558190c13ae05e.tar.bz2 |
Added new tools for managing and verifying the stack depth during compilation. Used it in some spots in the compiler and in TclCompileCatchCommand.
FossilOrigin-Name: c91b235146f0956b8f38e98acc266433ea4211cc
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r-- | generic/tclCompile.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 287ab1d..b3c8442 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1169,6 +1169,21 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); (envPtr)->currStackDepth += (delta); \ } while (0) +#define TclGetStackDepth(envPtr) \ + ((envPtr)->currStackDepth) + +#define TclSetStackDepth(depth, envPtr) \ + (envPtr)->currStackDepth = (depth) + +#define TclCheckStackDepth(depth, envPtr) \ + do { \ + int dd = (depth); \ + if (dd != (envPtr)->currStackDepth) { \ + Tcl_Panic("bad stack depth computations: is %i, should be %i", \ + (envPtr)->currStackDepth, dd); \ + } \ + } while (0) + /* * Macro used to update the stack requirements. It is called by the macros * TclEmitOpCode, TclEmitInst1 and TclEmitInst4. |