summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-30 17:01:47 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-30 17:03:50 +0100
commitde40fdd2d3c6edf65eed6f43d0d7731440bfb555 (patch)
tree34418e57479a76d45da07b01a1fd3eb076b94c5f /Source/JavaScriptCore
parent0cba511b6bf9cebbf325b3cfebeee7e5f85effe9 (diff)
downloadqtwebkit-de40fdd2d3c6edf65eed6f43d0d7731440bfb555.tar.gz
Crash in conversion of empty OpaqueJSString to Identifier
https://bugs.webkit.org/show_bug.cgi?id=101867 Patch by Allan Sandfeld Jensen <allan.jensen@digia.com> on 2012-11-30 Reviewed by NOBODY (OOPS!). The constructor call used for both null and empty OpaqueJSStrings results in an assertion voilation and crash. This patch instead uses the Identifier constructors which are specifically for null and empty Identifier. * API/OpaqueJSString.cpp: (OpaqueJSString::identifier): Change-Id: Ia685336d1310be99425d1f80ec29ed0020084061 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/JavaScriptCore')
-rw-r--r--Source/JavaScriptCore/API/OpaqueJSString.cpp7
-rw-r--r--Source/JavaScriptCore/ChangeLog14
2 files changed, 19 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/API/OpaqueJSString.cpp b/Source/JavaScriptCore/API/OpaqueJSString.cpp
index ac7cfd16a..90bc1c095 100644
--- a/Source/JavaScriptCore/API/OpaqueJSString.cpp
+++ b/Source/JavaScriptCore/API/OpaqueJSString.cpp
@@ -50,8 +50,11 @@ String OpaqueJSString::string() const
Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
{
- if (!this || !m_string.length())
- return Identifier(globalData, static_cast<const char*>(0));
+ if (!this || m_string.isNull())
+ return Identifier();
+
+ if (m_string.isEmpty())
+ return Identifier(Identifier::EmptyIdentifier);
if (m_string.is8Bit())
return Identifier(globalData, m_string.characters8(), m_string.length());
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 13066e436..7a50471b6 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2012-11-30 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ Crash in conversion of empty OpaqueJSString to Identifier
+ https://bugs.webkit.org/show_bug.cgi?id=101867
+
+ Reviewed by NOBODY (OOPS!).
+
+ The constructor call used for both null and empty OpaqueJSStrings results
+ in an assertion voilation and crash. This patch instead uses the Identifier
+ constructors which are specifically for null and empty Identifier.
+
+ * API/OpaqueJSString.cpp:
+ (OpaqueJSString::identifier):
+
2012-11-30 Tor Arne Vestbø <tor.arne.vestbo@digia.com>
[Qt] Place the LLIntOffsetsExtractor binaries in debug/release subdirs on Mac