Commit 724bff15 authored by dglazkov@chromium.org's avatar dglazkov@chromium.org

2009-08-12 Christian Plesner Hansen <christian.plesner.hansen@gmail.com>

        Reviewed by Dimitri Glazkov.

        [V8] Fix atomic string externalization crash.
        Atomic string externalization assumes that all non-empty strings
        can be externalized which is untrue on 64-bit.  This change fixed
        that.

        https://bugs.webkit.org/show_bug.cgi?id=28215

        This bug causes loads of test crashes, no need to add new tests
        specifically for this.

        * bindings/v8/V8Binding.cpp:
        (WebCore::v8StringToAtomicWebCoreString):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c7d5cf16
2009-08-12 Christian Plesner Hansen <christian.plesner.hansen@gmail.com>
Reviewed by Dimitri Glazkov.
[V8] Fix atomic string externalization crash.
Atomic string externalization assumes that all non-empty strings
can be externalized which is untrue on 64-bit. This change fixed
that.
https://bugs.webkit.org/show_bug.cgi?id=28215
This bug causes loads of test crashes, no need to add new tests
specifically for this.
* bindings/v8/V8Binding.cpp:
(WebCore::v8StringToAtomicWebCoreString):
2009-08-12 Ariya Hidayat <ariya.hidayat@nokia.com> 2009-08-12 Ariya Hidayat <ariya.hidayat@nokia.com>
Reviewed by Holger Freyther. Reviewed by Holger Freyther.
......
...@@ -154,14 +154,12 @@ AtomicString v8StringToAtomicWebCoreString(v8::Handle<v8::String> v8String) ...@@ -154,14 +154,12 @@ AtomicString v8StringToAtomicWebCoreString(v8::Handle<v8::String> v8String)
{ {
WebCoreStringResource* stringResource = WebCoreStringResource::toStringResource(v8String); WebCoreStringResource* stringResource = WebCoreStringResource::toStringResource(v8String);
if (!stringResource) { if (!stringResource) {
if (!v8String->CanMakeExternal())
return v8StringToWebCoreString(v8String, DoNotExternalize, AtomicStringType);
// If this string hasn't been externalized, we force it now. // If this string hasn't been externalized, we force it now.
String plain = v8StringToWebCoreString(v8String, Externalize, AtomicStringType); v8StringToWebCoreString(v8String, Externalize, AtomicStringType);
// If the string is empty there's no room to cache an atomic
// string so we bail out.
if (plain.isEmpty())
return plain;
stringResource = WebCoreStringResource::toStringResource(v8String); stringResource = WebCoreStringResource::toStringResource(v8String);
ASSERT(stringResource != NULL); ASSERT(stringResource);
} }
return stringResource->atomicString(); return stringResource->atomicString();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment