diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-26 19:03:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 02:03:38 +0800 |
commit | 13c72a986ce3f8e6b22fc957d98409009a149dfd (patch) | |
tree | d326c4a9d804cd7dcddf59f6f0d181dbcc3e02b7 /test/ufuzz/index.js | |
parent | 08af3eae4422a995f64f4eb2780248a56e85ccf8 (diff) | |
download | tracifyjs-13c72a986ce3f8e6b22fc957d98409009a149dfd.tar.gz tracifyjs-13c72a986ce3f8e6b22fc957d98409009a149dfd.zip |
fix corner case in infinite recursion detection (#3926)
Diffstat (limited to 'test/ufuzz/index.js')
-rw-r--r-- | test/ufuzz/index.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ufuzz/index.js b/test/ufuzz/index.js index df946c99..edd2ab80 100644 --- a/test/ufuzz/index.js +++ b/test/ufuzz/index.js @@ -1177,7 +1177,7 @@ function skip_infinite_recursion(orig, toplevel) { var code = orig; var tries = []; var offset = 0; - var re = /(?:(?:^|[\s{});])try|}\s*catch\s*\(([^)]+)\)|}\s*finally)\s*(?={)/g; + var re = /(?:(?:^|[\s{}):;])try|}\s*catch\s*\(([^)]+)\)|}\s*finally)\s*(?={)/g; var match; while (match = re.exec(code)) { if (/}\s*finally\s*$/.test(match[0])) { @@ -1185,7 +1185,7 @@ function skip_infinite_recursion(orig, toplevel) { continue; } var index = match.index + match[0].length + 1; - if (/(?:^|[\s{});])try\s*$/.test(match[0])) { + if (/(?:^|[\s{}):;])try\s*$/.test(match[0])) { tries.unshift({ try: index - offset }); continue; } |