Changeset 85621 in webkit


Ignore:
Timestamp:
May 3, 2011 10:34:15 AM (13 years ago)
Author:
alexis.menard@openbossa.org
Message:

2011-05-03 Xan Lopez <xlopez@igalia.com>

Reviewed by Anders Carlsson.

Compile error with GCC 4.6.0, tries to assign unsigned& to bitfield
https://bugs.webkit.org/show_bug.cgi?id=59261

Use unary '+' to force proper type detection in template arguments
with GCC 4.6.0. See bug report for more details.

  • runtime/Structure.cpp: (JSC::StructureTransitionTable::remove): Use '+' to force precise type detection. (JSC::StructureTransitionTable::add): ditto.
  • runtime/Structure.h: (JSC::StructureTransitionTable::keyForWeakGCMapFinalizer): ditto.
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r85605 r85621  
     12011-05-03  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Compile error with GCC 4.6.0, tries to assign unsigned& to bitfield
     6        https://bugs.webkit.org/show_bug.cgi?id=59261
     7
     8        Use unary '+' to force proper type detection in template arguments
     9        with GCC 4.6.0. See bug report for more details.
     10
     11        * runtime/Structure.cpp:
     12        (JSC::StructureTransitionTable::remove): Use '+' to force precise type detection.
     13        (JSC::StructureTransitionTable::add): ditto.
     14        * runtime/Structure.h:
     15        (JSC::StructureTransitionTable::keyForWeakGCMapFinalizer): ditto.
     16
    1172011-05-03  Jessie Berlin  <jberlin@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r85605 r85621  
    9797        // entry is structure (the latter check may fail if we initially had a
    9898        // transition with a specific value, and this has been despecified).
    99         TransitionMap::iterator entry = map()->find(make_pair(structure->m_nameInPrevious, structure->m_attributesInPrevious));
     99
     100        // Newer versions of the STL have an std::make_pair function that takes rvalue references.
     101        // When either of the parameters are bitfields, the C++ compiler will try to bind them as lvalues, which is invalid. To work around this, use unary "+" to make the parameter an rvalue.
     102        // See https://bugs.webkit.org/show_bug.cgi?id=59261 for more details
     103        TransitionMap::iterator entry = map()->find(make_pair(structure->m_nameInPrevious, +structure->m_attributesInPrevious));
    100104        if (entry != map()->end() && structure == entry.get().second)
    101105            map()->remove(entry);
     
    121125
    122126    // Add the structure to the map.
    123     std::pair<TransitionMap::iterator, bool> result = map()->add(globalData, make_pair(structure->m_nameInPrevious, structure->m_attributesInPrevious), structure);
     127
     128    // Newer versions of the STL have an std::make_pair function that takes rvalue references.
     129    // When either of the parameters are bitfields, the C++ compiler will try to bind them as lvalues, which is invalid. To work around this, use unary "+" to make the parameter an rvalue.
     130    // See https://bugs.webkit.org/show_bug.cgi?id=59261 for more details
     131    std::pair<TransitionMap::iterator, bool> result = map()->add(globalData, make_pair(structure->m_nameInPrevious, +structure->m_attributesInPrevious), structure);
    124132    if (!result.second) {
    125133        // There already is an entry! - we should only hit this when despecifying.
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r85605 r85621  
    306306    inline StructureTransitionTable::Hash::Key StructureTransitionTable::keyForWeakGCMapFinalizer(void*, Structure* structure)
    307307    {
    308         return Hash::Key(structure->m_nameInPrevious.get(), structure->m_attributesInPrevious);
     308        // Newer versions of the STL have an std::make_pair function that takes rvalue references.
     309        // When either of the parameters are bitfields, the C++ compiler will try to bind them as lvalues, which is invalid. To work around this, use unary "+" to make the parameter an rvalue.
     310        // See https://bugs.webkit.org/show_bug.cgi?id=59261 for more details.
     311        return Hash::Key(structure->m_nameInPrevious.get(), +structure->m_attributesInPrevious);
    309312    }
    310313
Note: See TracChangeset for help on using the changeset viewer.