Skip to content

Commit

Permalink
fix infinite recursion in ufuzz code generation (#4592)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed Jan 24, 2021
1 parent fd7ad8e commit a08d425
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/ufuzz/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1587,9 +1587,10 @@ function getVarName(noConst) {
function createVarName(maybe, dontStore) {
if (!maybe || rng(2)) {
var suffix = rng(3);
var name;
var name, tries = 10;
do {
name = VAR_NAMES[rng(VAR_NAMES.length)];
if (--tries < 0) suffix++;
if (suffix) name += "_" + suffix;
} while (unique_vars.indexOf(name) >= 0 || block_vars.indexOf(name) >= 0 || async && name == "await");
if (!dontStore) VAR_NAMES.push(name);
Expand Down

0 comments on commit a08d425

Please sign in to comment.