Skip to content

Commit

Permalink
codegen: fix regex proto crash
Browse files Browse the repository at this point in the history
test262: 55.10% | πŸ§ͺ 50254 | 🀠 27692 | ❌ 7207 | πŸ’€ 14007 (+1) | πŸ—οΈ 32 | πŸ’₯ 176 (-1) | ⏰ 141 | πŸ“ 999
  • Loading branch information
CanadaHonk committed Dec 15, 2024
1 parent 99af5d7 commit 00874bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions compiler/codegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2134,12 +2134,13 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
funcs.push(func);
}

const arg = decl.arguments[0] ?? DEFAULT_VALUE();
const idx = funcIndex[rhemynName];
return [
// make string arg
...generate(scope, decl.arguments[0]),
...generate(scope, arg),
Opcodes.i32_to_u,
...getNodeType(scope, decl.arguments[0]),
...getNodeType(scope, arg),

// call regex func
[ Opcodes.call, idx ],
Expand All @@ -2150,7 +2151,6 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
}

protoName = decl.callee.property.name;

target = decl.callee.object;
}

Expand Down
2 changes: 1 addition & 1 deletion test262/history.json

Large diffs are not rendered by default.

0 comments on commit 00874bd

Please sign in to comment.