Changeset 16542 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Sep 23, 2006, 11:08:18 AM (19 years ago)
Author:
ap
Message:

Reviewed by Maciej.

http://bugzilla.opendarwin.org/show_bug.cgi?id=10183
REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
(Fanfiction.net author pages not listing stories)

Rolled out the fix for bug 4139.

  • kjs/lexer.cpp: (Lexer::setCode): (Lexer::shift):
  • tests/mozilla/ecma/Array/15.4.5.1-1.js:
  • tests/mozilla/expected.html:

2006-09-22 Steve Falkenburg <[email protected]>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/lexer.cpp

    r15522 r16542  
    115115
    116116  // read first characters
    117   shift(4);
     117  current = (length > 0) ? code[0].uc : -1;
     118  next1 = (length > 1) ? code[1].uc : -1;
     119  next2 = (length > 2) ? code[2].uc : -1;
     120  next3 = (length > 3) ? code[3].uc : -1;
    118121}
    119122
    120123void Lexer::shift(unsigned int p)
    121124{
     125  // Here would be a good place to strip Cf characters, but that has caused compatibility problems:
     126  // <http://bugzilla.opendarwin.org/show_bug.cgi?id=10183>.
    122127  while (p--) {
     128    pos++;
    123129    current = next1;
    124130    next1 = next2;
    125131    next2 = next3;
    126     do {
    127       if (pos >= length) {
    128         next3 = -1;
    129         break;
    130       }
    131       next3 = code[pos++].uc;
    132     } while (WTF::Unicode::isFormatChar(next3));
     132    next3 = (pos + 3 < length) ? code[pos+3].uc : -1;
    133133  }
    134134}
Note: See TracChangeset for help on using the changeset viewer.