Changeset 4639 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp
- Timestamp:
- Jul 13, 2003, 2:40:45 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/ustring.cpp
r4630 r4639 686 686 const unsigned d = c - '0'; 687 687 688 // Check for overflow. 689 const unsigned maxProduct = 0xFFFFFFFFU - d; 690 if (i > maxProduct / 10) 688 // Multiply by 10, checking for overflow out of 32 bits. 689 if (i > 0xFFFFFFFFU / 10) 691 690 return 0; 691 i *= 10; 692 692 693 // Add in another digit. 694 i *= 10; 693 // Add in the digit, checking for overflow out of 32 bits. 694 const unsigned max = 0xFFFFFFFFU - d; 695 if (i > max) 696 return 0; 695 697 i += d; 696 698
Note:
See TracChangeset
for help on using the changeset viewer.