|
2007-08-09
| ||
| 03:25 | • Closed ticket [1770224fff]: TclGetNumberFromObj caller must save result plus... artifact: 6029c3c501 user: dgp | |
| 03:21 | • Ticket [1770224fff]: 4 changes artifact: 1006ae9485 user: dgp | |
| 03:21 | • Add attachment 1770224.patch to ticket [1770224fff] artifact: 63dbd4d3d7 user: dgp | |
| 02:35 | • Ticket [1770224fff] TclGetNumberFromObj caller must save result status still... artifact: f119dd41c0 user: dgp | |
| 02:07 | • Ticket [1770224fff]: 4 changes artifact: 46e12dcd26 user: dgp | |
|
2007-08-08
| ||
| 18:57 | • New ticket [1770224fff]. artifact: 7d4a50325e user: dgp | |
TclGetNumberFromObj caller must save result
Closed / Fixed1770224fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-08-08 18:57:44
For example: % >> -0x8000000000000001 0x8000000000000000 0 Result should be -1. [>> $big $wide] is ok: % >> -0x8000000000000001 0x7fffffffffffffff -1 And clearly, shifting that -1 one more bit ought to return -1 again, not 0. Perhaps a clue... it's not always broken: % >> -0x8000000000000000 0x8000000000000000 -1
dgpplain2007-08-09 02:07:41
Logged In: YES user_id=80530 Originator: YES ok that last "not broken" example actually fits in a wide.
dgpplain2007-08-09 02:35:22
Logged In: YES user_id=80530 Originator: YES ok, problem is that when TclGetNumberFromObj() returns a bignum, it uses some temp space. The caller is supposed to save the result before calling again. The >> implementation code is not doing so, so when both arguments are bignums, we end up doing the operation with the second argument twice. This not only points the way to fixing this bug; it points out a whole project of code review to be done. Ick.
dgpplain2007-08-09 03:21:05
File Added - 240469: 1770224.patch Logged In: YES user_id=80530 Originator: YES Ok, problem did not show up elsewhere. Here's the patch. File Added: 1770224.patch
dgpplain2007-08-09 03:25:04
Logged In: YES user_id=80530 Originator: YES committed.
Log in (anonymous is fine) to add a comment.
Attachments:
- 1770224.patch [download] added by dgp on 2007-08-09 03:21:04. [details]