[PATCH] KJS - fix toInt32 with some negative values (#61587)

Maks Orlovich orlovich at cs.rochester.edu
Thu Jul 24 02:30:59 BST 2003


Hi...

Currently, KJS mis-calculates toInt32 values for some negative numbers. For 
example, -2478659068 is converted to 0x80000000, aka MIN_INT. This is because 
the remainder for dividing this by 2^32 is negative, so we don't readjust it 
(as it's certainly < 2^31) and below MIN_INT, so casting from floating point 
to integer in ValueImp::toInt32 clamps. The attached diff appears to be the 
proper fix to me. If this is OK, is there anywhere where I can/should add a 
testcase for this?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: value_low_val.diff
Type: text/x-diff
Size: 673 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20030723/82d6237e/attachment.diff>


More information about the kfm-devel mailing list