fix: 修复忽略调用语句参数寄存器计数问题
This commit is contained in:
@@ -121,6 +121,11 @@ impl Compiler {
|
|||||||
}
|
}
|
||||||
Expression::CallExpression(call) => {
|
Expression::CallExpression(call) => {
|
||||||
self.count_expression(&call.callee, ctx);
|
self.count_expression(&call.callee, ctx);
|
||||||
|
for arg in &call.arguments {
|
||||||
|
if let Some(expr) = arg.as_expression() {
|
||||||
|
self.count_expression(expr, ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
ctx.alloc_reg();
|
ctx.alloc_reg();
|
||||||
ctx.projected_pc += 1; // CALL
|
ctx.projected_pc += 1; // CALL
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user