Artifacts Associated With Ticket 04e26c02c0459686
Ticket change [03dea3bd30] (rid 153317) by gahr on 2017-04-27 10:35:36:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Warning in tclExecute.c. A branch is never taken - TclCompareTwoNumbers states as prerequisite that the arguments are known to be of numeric and not NaN - but the compiler doesn't know it. generic/tclExecute.c:9244:12: warning: variable 'type1' is used uninitialized whenever '?:' condition is true [-Wsometimes-uninitialized] (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ generic/tclExecute.c:513:5: note: expanded from macro 'GetNumberFromObj' ((((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) || \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ generic/tclExecute.c:9247:13: note: uninitialized use occurs here switch (type1) { ^~~~~ generic/tclExecute.c:9244:12: note: remove the '?:' if its condition is always false (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1); ^ generic/tclExecute.c:513:5: note: expanded from macro 'GetNumberFromObj' ((((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) || \ ^ - foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "gahr"
- priority initialized to: "5 Medium"
- private_contact initialized to: "438e59f1f1c891b29d2528ed82d1e629cecc6336"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "gahr"
- subsystem initialized to: "None"
- title initialized to: "Warning"
- type initialized to: "Patch"
Ticket change [a3af971578] (rid 153322) by gahr on 2017-04-27 10:37:53:
- icomment: "A fix is available in the [tkt-04e26c02c0] branch."
- login: "gahr"
- mimetype: "text/plain"
- username: "[email protected]"
Ticket change [9cf9936d57] (rid 153346) by dgp on 2017-04-27 13:47:00:
- icomment:
It appears the error is in testing this condition at all: ((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) A valid Tcl_Obj must follow the stork model. It must be standing on at least one leg. The condition above is testing "If this stork is standing on 0 legs..." which has to always report false. Removing that seems to be the better solution, unless we can find some reason it was placed there that makes sense.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [d4ee6d3d84] (rid 153348) by dgp on 2017-04-27 16:34:53:
- icomment:
That test is present to preserve the same test done in earlier versions of the bytecode engine that trace back to this March 2000 "optimization": http://core.tcl.tk/tcl/info/6f0ee764c164f12f Best I can tell, that was just always (harmlessly) wrong, testing a condition that always has a known truth value. The comment alongside it is just blatantly false. Even back in that day, we were using tclEmptyString to represent our empty strings. A NULL objPtr->bytes was always a sign of a pure internal value, unless someone can show me otherwise. Whether it was always wrong, or became outdated and wrong, no need to keep the vestige anymore.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [fb5e6865a7] (rid 153358) by dgp on 2017-04-27 17:26:57:
- assignee changed to: "dgp"
- closedate changed to: "2457871.22704965"
- closer changed to: "dgp"
- icomment:
fixed on all dev branches.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- subsystem changed to: "47. Bytecode Compiler"
Ticket change [48488ed74f] (rid 153359) by gahr on 2017-04-28 06:04:42:
- closer changed to: "nobody"
- icomment:
I fear this won't be enough: there is still an error case that isn't checked by the two expansions in TclCompareTwoNumbers. This function assumes that the objects are of some numeric type, so the value of the expression is just discarded and type is expected to be set after the expansion. generic/tclExecute.c:9242:12: warning: variable 'type1' is used uninitialized whenever '?:' condition is true [-Wsometimes-uninitialized] (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ generic/tclExecute.c:513:5: note: expanded from macro 'GetNumberFromObj' (((objPtr)->bytes != NULL) && ((objPtr)->length == 0)) \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ generic/tclExecute.c:9245:13: note: uninitialized use occurs here switch (type1) { ^~~~~ generic/tclExecute.c:9242:12: note: remove the '?:' if its condition is always false (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1); ^ generic/tclExecute.c:513:5: note: expanded from macro 'GetNumberFromObj' (((objPtr)->bytes != NULL) && ((objPtr)->length == 0)) \ ^ generic/tclExecute.c:9233:14: note: initialize the variable 'type1' to silence this warning int type1, type2, compare; ^ = 0 1 warning generated. - login: "gahr"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "gahr"
Ticket change [a2838d8a4e] (rid 153383) by dgp on 2017-04-28 14:16:27:
- closedate changed to: "2457872.0947615"
- closer changed to: "dgp"
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Closed"