diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-08-26 22:47:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-08-26 22:47:05 (GMT) |
commit | c1b4a8688f530f2fb6ab049c3304c1d11e385ebc (patch) | |
tree | f07981157616618425e2ecc2f9ba8387f230325a /generic/tclExecute.c | |
parent | ce60b9f9bf7ea98961297c9757251a4abcdaa4de (diff) | |
download | tcl-c1b4a8688f530f2fb6ab049c3304c1d11e385ebc.zip tcl-c1b4a8688f530f2fb6ab049c3304c1d11e385ebc.tar.gz tcl-c1b4a8688f530f2fb6ab049c3304c1d11e385ebc.tar.bz2 |
Use TclOffset() in stead of magic calculations using sizeof(), which might give unexpected results when padding is involved
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 25b9409..a16334a 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -9629,7 +9629,7 @@ PrintByteCodeInfo( #ifdef TCL_COMPILE_STATS fprintf(stdout, " Code %lu = header %lu+inst %d+litObj %lu+exc %lu+aux %lu+cmdMap %d\n", (unsigned long) codePtr->structureSize, - (unsigned long) (sizeof(ByteCode)-sizeof(size_t)-sizeof(Tcl_Time)), + (unsigned long) (TclOffset(ByteCode, localCachePtr)), codePtr->numCodeBytes, (unsigned long) (codePtr->numLitObjects * sizeof(Tcl_Obj *)), (unsigned long) (codePtr->numExceptRanges*sizeof(ExceptionRange)), @@ -10272,7 +10272,7 @@ EvalStatsCmd( numCurrentByteCodes = statsPtr->numCompilations - statsPtr->numByteCodesFreed; currentHeaderBytes = numCurrentByteCodes - * (sizeof(ByteCode) - sizeof(size_t) - sizeof(Tcl_Time)); + * (TclOffset(ByteCode, localCachePtr)); literalMgmtBytes = sizeof(LiteralTable) + (iPtr->literalTable.numBuckets * sizeof(LiteralEntry *)) + (iPtr->literalTable.numEntries * sizeof(LiteralEntry)); |