Artifacts Associated With Ticket 526717ffffffffff
Ticket change [d807739446] (rid 107372) by dgp on 2002-03-07 00:33:14:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Use of a Tcl_WideInt as a list index will shimmer it to an "int". On a 32-bit platform: % set index [expr {(wide(1)<<31) - 2}] 2147483646 % lindex {1 2 3} $index % incr index 2147483647 % incr index -2147483648 Contrast with: % set index [expr {(wide(1)<<31) - 2}] 2147483646 % incr index 2147483647 % incr index 2147483648 It's worse on 64-bit platforms, where truncation is to an "int" even though Tcl_Integers are really longs: % set index [expr {wide(1)<<32}] 4294967296 % lindex {1 2 3} $index 1 % incr index 4294967297 % lindex {1 2 3} $index 2 So here, we don't lose range on the index values, but the indexing function "wraps around". Suspect trouble in TclGetIntForIndex - foundin initialized to: "obsolete: 8.4a5"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "10. Objects"
- title initialized to: "list indexing corrupts wide ints"
- type initialized to: "Bug"
Ticket change [565a88d666] (rid 94298) by dgp on 2002-03-07 07:36:26:
- icomment:
Logged In: YES user_id=80530 More generally, any place that Tcl_GetIntFromObj is called should be considered suspect.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [60b5f1a787] (rid 116042) by dkf on 2002-03-14 22:03:44:
- icomment:
Logged In: YES user_id=79902 I supoose we could make Tcl_GetIntFromObj know about wideobjs...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [7c709394b3] (rid 97079) by dkf on 2002-04-19 20:09:06:
- closedate changed to: "2002-04-19T13:09:06"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 TclGetIntForIndex really ought to use 'long' and 'long*' not 'int' and 'int*'...
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"