diff options
author | dgp <dgp@users.sourceforge.net> | 2017-08-09 16:28:33 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-08-09 16:28:33 (GMT) |
commit | 836f3ac65a594984917c6dd8de7f55ee6f48c504 (patch) | |
tree | 6bb89819d7af84860e1f3a3941afc756ca55ab81 /generic/tclObj.c | |
parent | af03c7e562cc37087f276fcd7aed692c5537056a (diff) | |
parent | 443f0a7ceffa45b9f450afea22b701c44f84b87b (diff) | |
download | tcl-836f3ac65a594984917c6dd8de7f55ee6f48c504.zip tcl-836f3ac65a594984917c6dd8de7f55ee6f48c504.tar.gz tcl-836f3ac65a594984917c6dd8de7f55ee6f48c504.tar.bz2 |
merge release
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index a346987..3bf5b8e 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4488,6 +4488,24 @@ Tcl_RepresentationCmd( objv[1]->typePtr ? objv[1]->typePtr->name : "pure string", objv[1]->refCount, ptrBuffer); + /* + * This is a workaround to silence reports from `make valgrind` + * on 64-bit systems. The problem is that the test suite + * includes calling the [represenation] command on values of + * &tclDoubleType. When these values are created, the "doubleValue" + * is set, but when the "twoPtrValue" is examined, its "ptr2" + * field has never been initialized. Since [representation] + * presents the value of the ptr2 value in its output, valgrind + * alerts about the read of uninitialized memory. + * + * The general problem with [representation], that it can read + * and report uninitialized fields, is still present. This is + * just the minimal workaround to silence one particular test. + */ + + if ((sizeof(void *) > 4) && objv[1]->typePtr == &tclDoubleType) { + objv[1]->internalRep.twoPtrValue.ptr2 = NULL; + } if (objv[1]->typePtr) { sprintf(ptrBuffer, "%p:%p", (void *) objv[1]->internalRep.twoPtrValue.ptr1, |