Changeset 58974 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
May 7, 2010, 3:18:41 PM (15 years ago)
Author:
[email protected]
Message:

Fixed Sputnik failure seen on buildbot.

Reviewed by Gavin Barraclough.

  • runtime/NumberPrototype.cpp:

(JSC::numberProtoFuncToString): Cast to unsigned before checking magnitude,
to efficiently exclude negative numbers, which require two characters
instead of one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/NumberPrototype.cpp

    r58970 r58974  
    162162        if (v.isInt32()) {
    163163            int x = v.asInt32();
    164             if (x < 36) {
     164            if (static_cast<unsigned>(x) < 36) { // Exclude negatives
    165165                JSGlobalData* globalData = &exec->globalData();
    166166                return globalData->smallStrings.singleCharacterString(globalData, digits[x]);
Note: See TracChangeset for help on using the changeset viewer.