| ... | ... | @@ -2409,10 +2409,11 @@ fn airLoad(f: *Function, inst: Air.Inst.Index) !CValue { |
| 2409 | 2409 | const ty_op = f.air.instructions.items(.data)[inst].ty_op; |
| 2410 | 2410 | const is_volatile = f.air.typeOf(ty_op.operand).isVolatilePtr(); |
| 2411 | 2411 | |
| 2412 | | if (!is_volatile and f.liveness.isUnused(inst)) |
| 2412 | const inst_ty = f.air.typeOfIndex(inst); |
| 2413 | if (!inst_ty.hasRuntimeBitsIgnoreComptime() or |
| 2414 | !is_volatile and f.liveness.isUnused(inst)) |
| 2413 | 2415 | return CValue.none; |
| 2414 | 2416 | |
| 2415 | | const inst_ty = f.air.typeOfIndex(inst); |
| 2416 | 2417 | const is_array = inst_ty.zigTypeTag() == .Array; |
| 2417 | 2418 | const operand = try f.resolveInst(ty_op.operand); |
| 2418 | 2419 | const writer = f.object.writer(); |
| ... | ... | @@ -2565,9 +2566,11 @@ fn airStoreUndefined(f: *Function, dest_ptr: CValue) !CValue { |
| 2565 | 2566 | fn airStore(f: *Function, inst: Air.Inst.Index) !CValue { |
| 2566 | 2567 | // *a = b; |
| 2567 | 2568 | const bin_op = f.air.instructions.items(.data)[inst].bin_op; |
| 2569 | const lhs_child_type = f.air.typeOf(bin_op.lhs).childType(); |
| 2570 | if (!lhs_child_type.hasRuntimeBitsIgnoreComptime()) return CValue.none; |
| 2571 | |
| 2568 | 2572 | const dest_ptr = try f.resolveInst(bin_op.lhs); |
| 2569 | 2573 | const src_val = try f.resolveInst(bin_op.rhs); |
| 2570 | | const lhs_child_type = f.air.typeOf(bin_op.lhs).childType(); |
| 2571 | 2574 | |
| 2572 | 2575 | // TODO Sema should emit a different instruction when the store should |
| 2573 | 2576 | // possibly do the safety 0xaa bytes for undefined. |