Changeset 158875 in webkit
- Timestamp:
- Nov 7, 2013 2:19:58 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158871 r158875 1 2013-11-07 Oliver Hunt <oliver@apple.com> 2 3 Reproducible crash when using Map (affects Web Inspector) 4 https://bugs.webkit.org/show_bug.cgi?id=123940 5 6 Reviewed by Geoffrey Garen. 7 8 Add testcases 9 10 * js/map-grow-with-holes-expected.txt: Added. 11 * js/map-grow-with-holes.html: Added. 12 * js/script-tests/map-grow-with-holes.js: Added. 13 (get map): 14 1 15 2013-11-07 Michał Pakuła vel Rutka <m.pakula@samsung.com> 2 16 -
trunk/Source/JavaScriptCore/ChangeLog
r158862 r158875 1 2013-11-07 Oliver Hunt <oliver@apple.com> 2 3 Reproducible crash when using Map (affects Web Inspector) 4 https://bugs.webkit.org/show_bug.cgi?id=123940 5 6 Reviewed by Geoffrey Garen. 7 8 Trivial fix. Once again we get bitten by attempting to be clever when 9 growing while adding entries to indexing maps. 10 11 Now we simply do a find(), and then add() _after_ we've ensured there is 12 sufficient space in the MapData list. 13 14 * runtime/MapData.cpp: 15 (JSC::MapData::add): 16 1 17 2013-11-07 Mark Lam <mark.lam@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/MapData.cpp
r155560 r158875 81 81 template <typename Map, typename Key> MapData::Entry* MapData::add(CallFrame* callFrame, Map& map, Key key, KeyType keyValue) 82 82 { 83 typename Map:: AddResult result = map.add(key, m_size);84 if ( !result.isNewEntry)85 return &m_entries[ result.iterator->value];86 if (!ensureSpaceForAppend(callFrame)) {87 map.remove(result.iterator);83 typename Map::iterator location = map.find(key); 84 if (location != map.end()) 85 return &m_entries[location->value]; 86 87 if (!ensureSpaceForAppend(callFrame)) 88 88 return 0; 89 } 90 89 90 auto result = map.add(key, m_size); 91 RELEASE_ASSERT(result.isNewEntry); 91 92 Entry* entry = &m_entries[m_size++]; 92 93 new (entry) Entry();
Note: See TracChangeset
for help on using the changeset viewer.