Changeset 39942 in webkit


Ignore:
Timestamp:
Jan 15, 2009 1:15:24 PM (15 years ago)
Author:
oliver@apple.com
Message:

Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
<https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>

Reviewed by Geoff Garen

Character position for open and closing brace was incorrectly referencing m_position to
record their position in a source document, however this is unsafe as BOMs may lead to
m_position being an arbitrary position from the real position of the current character.

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r39931 r39942  
     12009-01-15  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Geoff Garen.
     4
     5        Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
     6        <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
     7
     8        Character position for open and closing brace was incorrectly referencing m_position to
     9        record their position in a source document, however this is unsafe as BOMs may lead to
     10        m_position being an arbitrary position from the real position of the current character.
     11
     12        * parser/Lexer.cpp:
     13        (JSC::Lexer::matchPunctuator):
     14
    1152009-01-14  David Kilzer  <ddkilzer@apple.com>
    216
  • trunk/JavaScriptCore/parser/Lexer.cpp

    r39554 r39942  
    759759            return static_cast<int>(c1);
    760760        case '{':
    761             charPos = m_position - 4;
     761            charPos = m_currentOffset;
    762762            shift(1);
    763763            return OPENBRACE;
    764764        case '}':
    765             charPos = m_position - 4;
     765            charPos = m_currentOffset;
    766766            shift(1);
    767767            return CLOSEBRACE;
  • trunk/LayoutTests/ChangeLog

    r39927 r39942  
     12009-01-15  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Geoff Garen.
     4
     5        Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
     6        <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
     7
     8        Test to verify reparsing behaviour in the face of a BOM in the middle of the file.
     9
     10        * fast/js/bom-in-file-retains-correct-offset-expected.txt: Added.
     11        * fast/js/bom-in-file-retains-correct-offset.html: Added.
     12        * fast/js/resources/bom-in-file-retains-correct-offset.js: Added.
     13
    1142009-01-14  David Kilzer  <ddkilzer@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.