~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to JavaScriptCore/runtime/StringConstructor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-20 20:09:57 UTC
  • mfrom: (1.2.7 upstream) (4.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100120200957-3ng8lah18c7pmm52
* New upstream release
- Fixes crashes related to clearing the clipboard, which many users were
  experiencing (Closes: #565166)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec, const ArgList& args)
32
32
{
33
 
    UChar* buf = static_cast<UChar*>(fastMalloc(args.size() * sizeof(UChar)));
34
 
    UChar* p = buf;
35
 
    ArgList::const_iterator end = args.end();
36
 
    for (ArgList::const_iterator it = args.begin(); it != end; ++it)
37
 
        *p++ = static_cast<UChar>((*it).toUInt32(exec));
38
 
    return jsString(exec, UString::createNonCopying(buf, p - buf));
 
33
    unsigned length = args.size();
 
34
    UChar* buf;
 
35
    PassRefPtr<UStringImpl> impl = UStringImpl::createUninitialized(length, buf);
 
36
    for (unsigned i = 0; i < length; ++i)
 
37
        buf[i] = static_cast<UChar>(args.at(i).toUInt32(exec));
 
38
    return jsString(exec, impl);
39
39
}
40
40
 
41
41
static JSValue JSC_HOST_CALL stringFromCharCode(ExecState* exec, JSObject*, JSValue, const ArgList& args)