Changeset 194409 in webkit
- Timestamp:
- Dec 23, 2015, 6:17:03 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
API/JSScriptRef.cpp (modified) (3 diffs)
-
ChangeLog (modified) (1 diff)
-
parser/SourceProvider.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSScriptRef.cpp
r194017 r194409 49 49 unsigned hash() const override 50 50 { 51 return m_source. impl()->hash();51 return m_source.get().hash(); 52 52 } 53 53 54 54 StringView source() const override 55 55 { 56 return m_source ;56 return m_source.get(); 57 57 } 58 58 … … 63 63 : SourceProvider(url, TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())) 64 64 , m_vm(vm) 65 , m_source(source )65 , m_source(source.isNull() ? *StringImpl::empty() : *source.impl()) 66 66 { 67 67 } … … 70 70 71 71 VM* m_vm; 72 Stringm_source;72 Ref<StringImpl> m_source; 73 73 }; 74 74 -
trunk/Source/JavaScriptCore/ChangeLog
r194402 r194409 1 2015-12-23 Andreas Kling <akling@apple.com> 2 3 jsc CLI tool crashes on EOF. 4 <https://webkit.org/b/152522> 5 6 Reviewed by Benjamin Poulain. 7 8 SourceProvider should treat String() like the empty string for hashing purposes. 9 This was a subtle behavior change in r194017 due to how zero-length strings are 10 treated by StringImpl::createSubstringSharingImpl(). 11 12 I made these SourceProviders store a Ref<StringImpl> internally instead of a 13 String, to codify the fact that these strings can't be null strings. 14 15 I couldn't find a way to cause this crash through the API. 16 17 * API/JSScriptRef.cpp: 18 (OpaqueJSScript::OpaqueJSScript): 19 * parser/SourceProvider.h: 20 (JSC::StringSourceProvider::StringSourceProvider): 21 1 22 2015-12-23 Filip Pizlo <fpizlo@apple.com> 2 23 -
trunk/Source/JavaScriptCore/parser/SourceProvider.h
r194017 r194409 91 91 unsigned hash() const override 92 92 { 93 return m_source. impl()->hash();93 return m_source.get().hash(); 94 94 } 95 95 96 96 virtual StringView source() const override 97 97 { 98 return m_source ;98 return m_source.get(); 99 99 } 100 100 … … 102 102 StringSourceProvider(const String& source, const String& url, const TextPosition& startPosition) 103 103 : SourceProvider(url, startPosition) 104 , m_source(source )104 , m_source(source.isNull() ? *StringImpl::empty() : *source.impl()) 105 105 { 106 106 } 107 107 108 Stringm_source;108 Ref<StringImpl> m_source; 109 109 }; 110 110
Note:
See TracChangeset
for help on using the changeset viewer.