Artifacts Associated With Ticket 0439e1e1a37ff9c6
Ticket change [2fa5bded1e] (rid 228438) by jan.nijtmans on 2024-07-05 09:03:41:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Example: <pre> $ tclsh9.0 % set x [lseq 1 11111111111111];set y 5 5 % expr {$x+$y} </pre> Doing this hangs a long time, because a string representation is generated for the lseq. But we know already that an lseq with 0 or >1 entry can never be handled by '+'. Would be nice to detect that early, without taking that much time. - foundin initialized to: "8.7/9.0"
- is_private initialized to: "0"
- login: "jan.nijtmans"
- priority initialized to: "5 Medium"
- private_contact initialized to: "0c50e5320704d174412e57b873d8932de15303e0"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "jan.nijtmans"
- subsystem initialized to: "48. Number Handling"
- title initialized to: "Slow detection of illegal expr argument"
- type initialized to: "Bug"
Ticket change [3ca4d20084] (rid 228445) by jan.nijtmans on 2024-07-05 10:01:10:
- assignee changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
Ticket change [437fb36327] (rid 228458) by jan.nijtmans on 2024-07-07 14:10:12:
- icomment:
I think [2290847d23a494e4|this] is how it should be: If the obj being handled by "expr" can be represented as a list and has more than 1 element (so a dict as well), it now gives a slightly different error-message: <pre> % set x [lseq 1 11111111111111];set y 5 5 % expr {$x+$y} can't use a list as operand of "+" </pre> A side-effect of this is that Tcl_GetNumberFromObj() now tries to convert the object to a list, if it isn't already one of the other known types (like dict, lseq, or index). That's very useful in further error-handling, since the typePtr or lengthProc then can be inspected for this case without trying to do more parsing. It might also be very useful for the implementation of a future Tcl_GetValueFromObj() .... - login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [36ede3212e] (rid 228459) by jan.nijtmans on 2024-07-07 14:10:38:
- icomment:
I think [2290847d23a494e4|this] is how it should be: If the obj being handled by "expr" can be represented as a list and has more than 1 element (so a dict as well), it now gives a slightly different error-message: <pre> % set x [lseq 1 11111111111111];set y 5 5 % expr {$x+$y} can't use a list as operand of "+" </pre> A side-effect of this is that Tcl_GetNumberFromObj() now tries to convert the object to a list, if it isn't already one of the other known types (like dict, lseq, or index). That's very useful in further error-handling, since the typePtr or lengthProc then can be inspected for this case without trying to do more parsing. It might also be very useful for the implementation of a future Tcl_GetValueFromObj() .... - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [00d3f1202a] (rid 228571) by jan.nijtmans on 2024-07-08 20:27:32:
- icomment:
Remark by Brian Griffin: <pre> The only change I would recommend is to not use a contraction in the error message. In other words, use “cannot” instead of “can’t”. IMO, messages should be formal, not conversational. -Brian </pre>
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [bc83c84951] (rid 228572) by jan.nijtmans on 2024-07-08 20:29:20:
- icomment:
Christian Werner wrote: <pre> While I fully support elimination of single single quotes in error messages regardless of formalism or conversation I wonder how many omelettes we'll be able to make from the potentially many broken eggs. Alternatively, we could conserve these eggs for later. Best, Christian <pre>
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [cd5af38b9e] (rid 228577) by jan.nijtmans on 2024-07-09 09:32:08:
- icomment:
While testing: <pre> $ tclsh9.0 % set x [lseq 1 11111111111111];set y 5 5 % if {$x} {puts stdout abc} </pre> This also hangs, and could be handled the same way. - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [1ec8413c9b] (rid 228591) by jan.nijtmans on 2024-07-09 13:38:38:
- icomment:
More examples handled now (integers and doubles): <pre> $ tclsh9.0 % set x [lseq 1 11111111111111] 5 % binary encode base64 -maxlen $x data expected integer but got a list % binary format d $x expected floating-point number but got a list </pre> See: [5d333307578b6a00]
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [9721cfc297] (rid 233835) by dgp on 2024-09-26 17:01:10:
- icomment:
Beware that TclMaxListLength() is not written to be accurate. It is written to be reasonably quick, and to produce an over-estimate of how many elements the list might have -- if it is a list at all. Calling something "a list" because TMLL() returns a value bigger than 1 is not an accurate claim.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [686b6fc13b] (rid 233853) by jan.nijtmans on 2024-09-26 19:45:45:
- icomment:
> Calling something "a list" because TMLL() returns a value bigger than 1 is not an accurate claim. Indeed! There's still time until 9.0.1 to make it better. Current use was meant as a quick fix, in order to - at least - prevent conversion to a list.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [2c2f7d6d47] (rid 234063) by jan.nijtmans on 2024-10-08 22:40:56:
- closedate changed to: "2460592.4450961"
- closer changed to: "jan.nijtmans"
- icomment:
Should be [a618dcb27007fabd|better] now. Also (partly) backported to 8.7
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"