chakra-core / ChakraCore

ChakraCore is an open source Javascript engine with a C API.
MIT License
9.1k stars 1.19k forks source link

ASSERTION 445506: (ChakraCore/lib/Backend/FlowGraph.cpp, line 2064) #6947

Open anbu1024 opened 1 year ago

anbu1024 commented 1 year ago

ChakraCore version: commit c3ead3f

Build cmd:

./build.sh --debug --static

Test case:

function foo(){
    const s = /(\w+)/imsu;
    const sss = s.toString();
    const match = sss.match(sss);

    try {
        const x = ~sss;
        switch (x) {
            case x:
                try {
                    break;
                } 
                finally {
                }
                break;
            default:
                break;
        }
    } 
    finally {
        s.compile(sss);
    }

    const ret = Object(match, 1, match, 1);
    return ret;
}

let i = 0;
while(i < 1024)
{
    foo();
    i++;
}

Execute

./ch ./test.js

Error msg:

ASSERTION 445506: (ChakraCore/lib/Backend/FlowGraph.cpp, line 2064) tryRegion->GetMatchingFinallyRegion(true) != nullptr
 Failure: (tryRegion->GetMatchingFinallyRegion(true) != nullptr)
Illegal instruction (core dumped)