Overview
| Artifact ID: | 6bbea75da82b802b2f315398f8e3a54ac7ecd1dcd73c98449b38ef62fc1730b3 |
|---|---|
| Ticket: | 76ad7aeba3e7049e392079c1aea8044d73c0ef17
boundary case bug in [string is integer] |
| User & Date: | jan.nijtmans on 2022-05-22 17:22:53 |
Changes
- assignee changed to: "jan.nijtmans"
- icomment:
Proposed fix [66a187edf25e7d07|here]. Yes, it looks like there - indeed - was a bug in Tcl_GetIntFromObj(), already exposed by testcases get-1.7 up to get-1.14. The strange thing is that Tcl_GetIntFromObj() is documented to return TCL_OK for values between -(UINT_MAX) and UINT_MAX, while Tcl_GetLongFromObj() is documented to return TCL_OK for values between -(ULONG_MAX) and ULONG_MAX. This means that Tcl_GetLongFromObj() is not usable to check whether the obj can be stored in a (long). Proposed solution: use TclGetNumberFromObj() to do the range-check first. That's what the compiled code does too ;-) Please review! Someone interested to write a bunch of unit-tests?
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"