• fpizlo@apple.com's avatar
    Nested try/finally should not confuse the finally unpopper in... · 84c256c3
    fpizlo@apple.com authored
    Nested try/finally should not confuse the finally unpopper in BytecodeGenerator::emitComplexJumpScopes
    https://bugs.webkit.org/show_bug.cgi?id=97508
    <rdar://problem/12361132>
    
    Reviewed by Sam Weinig.
    
    Source/JavaScriptCore: 
    
    We're reusing some vector for multiple iterations of a loop, but we were forgetting to clear its
    contents from one iteration to the next. Hence if you did multiple iterations of finally unpopping
    (like in a nested try/finally and a jump out of both of them) then you'd get a corrupted try
    context stack afterwards.
    
    * bytecompiler/BytecodeGenerator.cpp:
    (JSC::BytecodeGenerator::emitComplexJumpScopes):
    
    LayoutTests: 
    
    * fast/js/jsc-test-list:
    * fast/js/script-tests/try-try-return-finally-finally.js: Added.
    (foo):
    * fast/js/try-try-return-finally-finally-expected.txt: Added.
    * fast/js/try-try-return-finally-finally.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    84c256c3
try-try-return-finally-finally-expected.txt 337 Bytes