| ... | ... | @@ -1242,7 +1242,7 @@ fn genFunc(func: *CodeGen) InnerError!void { |
| 1242 | 1242 | |
| 1243 | 1243 | // check if we have to initialize and allocate anything into the stack frame. |
| 1244 | 1244 | // If so, create enough stack space and insert the instructions at the front of the list. |
| 1245 | | if (func.stack_size > 0) { |
| 1245 | if (func.initial_stack_value != .none) { |
| 1246 | 1246 | var prologue = std.ArrayList(Mir.Inst).init(func.gpa); |
| 1247 | 1247 | defer prologue.deinit(); |
| 1248 | 1248 | |
| ... | ... | @@ -1963,11 +1963,11 @@ fn genInst(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 1963 | 1963 | .tag_name => func.airTagName(inst), |
| 1964 | 1964 | |
| 1965 | 1965 | .error_set_has_value => func.airErrorSetHasValue(inst), |
| 1966 | .frame_addr => func.airFrameAddress(inst), |
| 1966 | 1967 | |
| 1967 | 1968 | .mul_sat, |
| 1968 | 1969 | .mod, |
| 1969 | 1970 | .assembly, |
| 1970 | | .frame_addr, |
| 1971 | 1971 | .bit_reverse, |
| 1972 | 1972 | .is_err_ptr, |
| 1973 | 1973 | .is_non_err_ptr, |
| ... | ... | @@ -6969,3 +6969,12 @@ fn airAtomicStore(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6969 | 6969 | |
| 6970 | 6970 | return func.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs }); |
| 6971 | 6971 | } |
| 6972 | |
| 6973 | fn airFrameAddress(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6974 | if (func.initial_stack_value == .none) { |
| 6975 | try func.initializeStack(); |
| 6976 | } |
| 6977 | try func.emitWValue(func.bottom_stack_value); |
| 6978 | const result = try WValue.toLocal(.stack, func, Type.usize); |
| 6979 | return func.finishAir(inst, result, &.{}); |
| 6980 | } |