Changeset 166240 in webkit


Ignore:
Timestamp:
Mar 25, 2014 11:00:30 AM (10 years ago)
Author:
oliver@apple.com
Message:

ASSERTION FAILED in Parser: dst != localReg
https://bugs.webkit.org/show_bug.cgi?id=130710

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Just make sure we don't try to write to a captured constant,
following the change to track captured variables separately.

  • bytecompiler/NodesCodegen.cpp:

(JSC::PostfixNode::emitResolve):
(JSC::PrefixNode::emitResolve):

LayoutTests:

New testcases.

  • js/parser-syntax-check-expected.txt:
  • js/script-tests/parser-syntax-check.js:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r166238 r166240  
     12014-03-24  Oliver Hunt  <oliver@apple.com>
     2
     3        ASSERTION FAILED in Parser: dst != localReg
     4        https://bugs.webkit.org/show_bug.cgi?id=130710
     5
     6        Reviewed by Filip Pizlo.
     7
     8        New testcases.
     9
     10        * js/parser-syntax-check-expected.txt:
     11        * js/script-tests/parser-syntax-check.js:
     12
    1132014-03-24  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/LayoutTests/js/parser-syntax-check-expected.txt

    r166216 r166240  
    351351PASS Invalid: "const a = b : c"
    352352PASS Invalid: "function f() { const a = b : c }"
     353PASS Valid:   "const a = 7; eval(''); a++"
     354PASS Valid:   "function f() { const a = 7; eval(''); a++ }"
     355PASS Valid:   "const a = 7; eval(''); a--"
     356PASS Valid:   "function f() { const a = 7; eval(''); a-- }"
     357PASS Valid:   "const a = 7; with({}) a++"
     358PASS Valid:   "function f() { const a = 7; with({}) a++ }"
     359PASS Valid:   "const a = 7; with({}) a--"
     360PASS Valid:   "function f() { const a = 7; with({}) a-- }"
     361PASS Valid:   "const a = 7; eval(''); a+=1"
     362PASS Valid:   "function f() { const a = 7; eval(''); a+=1 }"
     363PASS Valid:   "const a = 7; eval(''); a-=1"
     364PASS Valid:   "function f() { const a = 7; eval(''); a-=1 }"
     365PASS Valid:   "const a = 7; with({}) a+=1"
     366PASS Valid:   "function f() { const a = 7; with({}) a+=1 }"
     367PASS Valid:   "const a = 7; with({}) a-=1"
     368PASS Valid:   "function f() { const a = 7; with({}) a-=1 }"
     369PASS Valid:   "const a = 7; eval(''); a=1"
     370PASS Valid:   "function f() { const a = 7; eval(''); a=1 }"
     371PASS Valid:   "const a = 7; eval(''); a=1"
     372PASS Valid:   "function f() { const a = 7; eval(''); a=1 }"
     373PASS Valid:   "const a = 7; with({}) a=1"
     374PASS Valid:   "function f() { const a = 7; with({}) a=1 }"
     375PASS Valid:   "const a = 7; with({}) a=1"
     376PASS Valid:   "function f() { const a = 7; with({}) a=1 }"
    353377for statement
    354378PASS Valid:   "for ( ; ; ) { break }"
  • trunk/LayoutTests/js/script-tests/parser-syntax-check.js

    r166216 r166240  
    242242invalid("var a = b ? c, b");
    243243invalid("const a = b : c");
     244valid("const a = 7; eval(''); a++");
     245valid("const a = 7; eval(''); a--");
     246valid("const a = 7; with({}) a++");
     247valid("const a = 7; with({}) a--");
     248valid("const a = 7; eval(''); a+=1");
     249valid("const a = 7; eval(''); a-=1");
     250valid("const a = 7; with({}) a+=1");
     251valid("const a = 7; with({}) a-=1");
     252valid("const a = 7; eval(''); a=1");
     253valid("const a = 7; eval(''); a=1");
     254valid("const a = 7; with({}) a=1");
     255valid("const a = 7; with({}) a=1");
     256
    244257
    245258debug  ("for statement");
  • trunk/Source/JavaScriptCore/ChangeLog

    r166239 r166240  
     12014-03-24  Oliver Hunt  <oliver@apple.com>
     2
     3        ASSERTION FAILED in Parser: dst != localReg
     4        https://bugs.webkit.org/show_bug.cgi?id=130710
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Just make sure we don't try to write to a captured constant,
     9        following the change to track captured variables separately.
     10
     11        * bytecompiler/NodesCodegen.cpp:
     12        (JSC::PostfixNode::emitResolve):
     13        (JSC::PrefixNode::emitResolve):
     14
    1152014-03-25  Martin Robinson  <mrobinson@igalia.com>
    216
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r166107 r166240  
    741741            generator.emitReadOnlyExceptionIfNeeded();
    742742            localReg = generator.emitMove(generator.tempDestination(dst), localReg);
    743         }
    744         if (local.isCaptured()) {
     743        } else if (local.isCaptured()) {
    745744            RefPtr<RegisterID> tempDst = generator.finalDestination(dst);
    746745            ASSERT(dst != localReg);
     
    917916            generator.emitReadOnlyExceptionIfNeeded();
    918917            localReg = generator.emitMove(generator.tempDestination(dst), localReg);
    919         }
    920         if (local.isCaptured()) {
     918        } else if (local.isCaptured()) {
    921919            RefPtr<RegisterID> tempDst = generator.tempDestination(dst);
    922920            generator.emitMove(tempDst.get(), localReg);
Note: See TracChangeset for help on using the changeset viewer.