Bug 652438 - Add back OOM checks in JSString::getChars (r=waldo)

This commit is contained in:
Luke Wagner 2011-04-25 11:53:50 -07:00
parent f52bbc7614
commit c7e18b4a7b

View File

@ -694,13 +694,17 @@ JS_STATIC_ASSERT(sizeof(JSStaticAtom) == sizeof(JSString));
JS_ALWAYS_INLINE const jschar *
JSString::getChars(JSContext *cx)
{
return ensureLinear(cx)->chars();
if (JSLinearString *str = ensureLinear(cx))
return str->chars();
return NULL;
}
JS_ALWAYS_INLINE const jschar *
JSString::getCharsZ(JSContext *cx)
{
return ensureFlat(cx)->chars();
if (JSFlatString *str = ensureFlat(cx))
return str->chars();
return NULL;
}
JS_ALWAYS_INLINE JSLinearString *