Skip to content

Commit 188b958

Browse files
committed
Better fix for throw argument thing (I think)
1 parent 1393b69 commit 188b958

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

backends/asm/optimize_ir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ static bool FuncUsesArgEx(Operand *func, Operand *arg, bool actually)
982982
return !actually;
983983
} else if (func && func->val && peek_into_func) {
984984
Function *funcObj = (Function *)func->val;
985-
if ((/*func->kind == IMM_COG_LABEL ||*/ func->kind == IMM_HUB_LABEL) && (actually || funcObj->is_leaf || FuncData(funcObj)->effectivelyLeaf) && !funcObj->has_throw) {
985+
if ((/*func->kind == IMM_COG_LABEL ||*/ func->kind == IMM_HUB_LABEL) && (actually || funcObj->is_leaf || FuncData(funcObj)->effectivelyLeaf)) {
986986
if (arg->kind != REG_ARG) return true; // subreg or smth
987987
if (arg->val < funcObj->numparams) return true; // Arg used;
988988
if (!actually && arg->val < FuncData(funcObj)->maxInlineArg) return true; // Arg clobbered
@@ -5605,7 +5605,7 @@ ExpandInlines(IRList *irl)
56055605
ir = ir_next;
56065606
}
56075607
// If inlining (or previous dead-code optimization...) removed all external calls, mark as leaf.
5608-
if (non_inline_calls==0 && !curfunc->is_leaf && !FuncData(curfunc)->effectivelyLeaf && !curfunc->has_throw) {
5608+
if (non_inline_calls==0 && !curfunc->is_leaf && !FuncData(curfunc)->effectivelyLeaf) {
56095609
FuncData(curfunc)->effectivelyLeaf = true;
56105610
change = true;
56115611
}

backends/asm/outasm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5266,6 +5266,7 @@ static void CompileStatement(IRList *irl, IRList *cold_irl, AST *ast)
52665266
EmitMove(irl, GetArgReg(1), op, ast);
52675267
EmitMove(irl, GetArgReg(2), NewImmediate(ast->d.ival), ast);
52685268
EmitOp1(irl, OPC_CALL, longjmpfunc);
5269+
updateMax(&FuncData(curfunc)->maxInlineArg,3);
52695270
break;
52705271
case AST_LABEL:
52715272
EmitDebugComment(irl, ast);

0 commit comments

Comments
 (0)