Artifacts Associated With Ticket aaa02c55b9cb7b62
Ticket change [d2b7338466] (rid 157656) by jan.nijtmans on 2017-11-03 08:56:53:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
<pre>% lrange {a b c} 15 end % lrange {a b c} 2147483649 end a b c</pre> This is strange. First result is as expected, second should give an empty list as result as well. - foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "jan.nijtmans"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "jan.nijtmans"
- subsystem initialized to: "13. Index Object"
- title initialized to: "lrange with huge index, weird results"
- type initialized to: "Bug"
Ticket change [e92c8e844d] (rid 157657) by sebres on 2017-11-03 09:43:47:
- icomment:
Hi Jan, as you certainly know, the index is signed integer here, thus just do `expr {int(2147483649)}` -> -2147483647 :) The options: - Rather the index should be retrieved as INT_MAX in such cases (which could be also too dangerous e. g. will unexpectedly return something for very large lists); - Or the API for indices should be rewritten to wide-int (incompatible then); - Or the error "integer too large" should be thrown (which will be certainly annoying sometimes). - login: "sebres"
- mimetype: "text/plain"
- icomment:
Ticket change [f047f8d0ea] (rid 157675) by jan.nijtmans on 2017-11-03 10:42:01:
- icomment:
First shot for proposed solution in branch "bug-aaa02c55b9". For Tcl8 I would like to clamp the values between INT_MIN and INT_MAX. I don't think that's too dangerous, since we can allready use INT_MAX in scripts directly: We must already handle that, anywhere we are failing to do so is a bug. For Tcl9, I would like to modify the API (which is just internal, so that's OK) to use "size_t *" in stead of "int *". Then we can clamp between -1 (represented as (size_t)-1) and LLONG_MAX (actually (size_t)-2), which is sufficiently for all future memory limitations. ;-) TIP is in preparation (sofar only in my mind yet ...)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [25607905d5] (rid 157676) by dgp on 2017-11-03 12:01:02:
- icomment:
See also TIP 297.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [7d1480d1a7] (rid 157682) by jan.nijtmans on 2017-11-03 12:26:29:
- assignee changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
Ticket change [68c217f17a] (rid 173054) by jan.nijtmans on 2019-07-05 12:28:09:
- closedate changed to: "2458670.01955926"
- closer changed to: "jan.nijtmans"
- icomment:
Since TIP #297 is in the core now, everything as expected now! Closing.
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [42ebe0cdf4] (rid 173102) by dgp on 2019-07-05 14:37:49:
- closedate changed to: "2458670.10960336"
- closer changed to: "dgp"
- icomment:
Just for the record, the behavior change was approved in TIP 502.
- login: "dgp"
- mimetype: "text/plain"