Ignore:
Timestamp:
Feb 26, 2013, 4:38:14 PM (12 years ago)
Author:
[email protected]
Message:

Web Inspector: REGRESSION: [JSC] SourceProvider reuses IDs
https://bugs.webkit.org/show_bug.cgi?id=99674

Reviewed by Gavin Barraclough.

Simple incrementing counter for SourceProvider IDs. Uses a
lock to incrementing the counter so we don't increment reuse
counter values or reassign the ID for a given SourceProvider.

  • parser/SourceProvider.cpp:

(JSC::SourceProvider::SourceProvider):
(JSC):
(JSC::SourceProvider::getID):

  • parser/SourceProvider.h:

(JSC::SourceProvider::asID):
(SourceProvider):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceProvider.h

    r143279 r144122  
    5959            if (!this) // Be defensive in release mode.
    6060                return nullID;
    61             return reinterpret_cast<intptr_t>(this);
     61            if (!m_id)
     62                getID();
     63            return m_id;
    6264        }
    6365
     
    6769    private:
    6870
     71        JS_EXPORT_PRIVATE void getID();
     72
    6973        String m_url;
    7074        TextPosition m_startPosition;
    71         bool m_validated;
     75        bool m_validated : 1;
     76        uintptr_t m_id : sizeof(uintptr_t) * 8 - 1;
    7277    };
    7378
Note: See TracChangeset for help on using the changeset viewer.