| author | |
| committer | |
| log | 8facd99d41b1290f9b29ec22c9dcce680d972810 |
| tree | 0ab61812da58df4127b8b56ec43eb88c0e6d5eb2 |
| parent | d038676a1f46ecab2bd095d3503ab05bcd8de58c |
| parent | 8be4511061f18e1bf2b6f7bf108482c6d1e30aa6 |
| signature |
`@memmove` followups13 files changed, 60 insertions(+), 96 deletions(-)
lib/std/debug.zig+4-6| ... | ... | @@ -126,18 +126,16 @@ pub fn FullPanic(comptime panicFn: fn ([]const u8, ?usize) noreturn) type { |
| 126 | 126 | @branchHint(.cold); |
| 127 | 127 | call("for loop over objects with non-equal lengths", @returnAddress()); |
| 128 | 128 | } |
| 129 | pub fn memcpyLenMismatch() noreturn { | |
| 129 | /// Delete after next zig1.wasm update | |
| 130 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 131 | pub fn copyLenMismatch() noreturn { | |
| 130 | 132 | @branchHint(.cold); |
| 131 | call("@memcpy arguments have non-equal lengths", @returnAddress()); | |
| 133 | call("source and destination arguments have non-equal lengths", @returnAddress()); | |
| 132 | 134 | } |
| 133 | 135 | pub fn memcpyAlias() noreturn { |
| 134 | 136 | @branchHint(.cold); |
| 135 | 137 | call("@memcpy arguments alias", @returnAddress()); |
| 136 | 138 | } |
| 137 | pub fn memmoveLenMismatch() noreturn { | |
| 138 | @branchHint(.cold); | |
| 139 | call("@memmove arguments have non-equal lengths", @returnAddress()); | |
| 140 | } | |
| 141 | 139 | pub fn noreturnReturned() noreturn { |
| 142 | 140 | @branchHint(.cold); |
| 143 | 141 | call("'noreturn' function returned", @returnAddress()); |
lib/std/debug/no_panic.zig+4-6| ... | ... | @@ -125,17 +125,15 @@ pub fn forLenMismatch() noreturn { |
| 125 | 125 | @trap(); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | pub fn memcpyLenMismatch() noreturn { | |
| 129 | @branchHint(.cold); | |
| 130 | @trap(); | |
| 131 | } | |
| 128 | /// Delete after next zig1.wasm update | |
| 129 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 132 | 130 | |
| 133 | pub fn memcpyAlias() noreturn { | |
| 131 | pub fn copyLenMismatch() noreturn { | |
| 134 | 132 | @branchHint(.cold); |
| 135 | 133 | @trap(); |
| 136 | 134 | } |
| 137 | 135 | |
| 138 | pub fn memmoveLenMismatch() noreturn { | |
| 136 | pub fn memcpyAlias() noreturn { | |
| 139 | 137 | @branchHint(.cold); |
| 140 | 138 | @trap(); |
| 141 | 139 | } |
lib/std/debug/simple_panic.zig+5-6| ... | ... | @@ -120,18 +120,17 @@ pub fn forLenMismatch() noreturn { |
| 120 | 120 | call("for loop over objects with non-equal lengths", null); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | pub fn memcpyLenMismatch() noreturn { | |
| 124 | call("@memcpy arguments have non-equal lengths", null); | |
| 123 | /// Delete after next zig1.wasm update | |
| 124 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 125 | ||
| 126 | pub fn copyLenMismatch() noreturn { | |
| 127 | call("source and destination have non-equal lengths", null); | |
| 125 | 128 | } |
| 126 | 129 | |
| 127 | 130 | pub fn memcpyAlias() noreturn { |
| 128 | 131 | call("@memcpy arguments alias", null); |
| 129 | 132 | } |
| 130 | 133 | |
| 131 | pub fn memmoveLenMismatch() noreturn { | |
| 132 | call("@memmove arguments have non-equal lengths", null); | |
| 133 | } | |
| 134 | ||
| 135 | 134 | pub fn noreturnReturned() noreturn { |
| 136 | 135 | call("'noreturn' function returned", null); |
| 137 | 136 | } |
lib/std/zig/Zir.zig+3-3| ... | ... | @@ -983,12 +983,12 @@ pub const Inst = struct { |
| 983 | 983 | /// Implements the `@memcpy` builtin. |
| 984 | 984 | /// Uses the `pl_node` union field with payload `Bin`. |
| 985 | 985 | memcpy, |
| 986 | /// Implements the `@memset` builtin. | |
| 987 | /// Uses the `pl_node` union field with payload `Bin`. | |
| 988 | memset, | |
| 989 | 986 | /// Implements the `@memmove` builtin. |
| 990 | 987 | /// Uses the `pl_node` union field with payload `Bin`. |
| 991 | 988 | memmove, |
| 989 | /// Implements the `@memset` builtin. | |
| 990 | /// Uses the `pl_node` union field with payload `Bin`. | |
| 991 | memset, | |
| 992 | 992 | /// Implements the `@min` builtin for 2 args. |
| 993 | 993 | /// Uses the `pl_node` union field with payload `Bin` |
| 994 | 994 | min, |
src/Sema.zig+14-34| ... | ... | @@ -1574,17 +1574,17 @@ fn analyzeBodyInner( |
| 1574 | 1574 | continue; |
| 1575 | 1575 | }, |
| 1576 | 1576 | .memcpy => { |
| 1577 | try sema.zirMemcpy(block, inst); | |
| 1577 | try sema.zirMemcpy(block, inst, .memcpy, true); | |
| 1578 | 1578 | i += 1; |
| 1579 | 1579 | continue; |
| 1580 | 1580 | }, |
| 1581 | .memset => { | |
| 1582 | try sema.zirMemset(block, inst); | |
| 1581 | .memmove => { | |
| 1582 | try sema.zirMemcpy(block, inst, .memmove, false); | |
| 1583 | 1583 | i += 1; |
| 1584 | 1584 | continue; |
| 1585 | 1585 | }, |
| 1586 | .memmove => { | |
| 1587 | try sema.zirMemmove(block, inst); | |
| 1586 | .memset => { | |
| 1587 | try sema.zirMemset(block, inst); | |
| 1588 | 1588 | i += 1; |
| 1589 | 1589 | continue; |
| 1590 | 1590 | }, |
| ... | ... | @@ -25630,19 +25630,12 @@ fn upgradeToArrayPtr(sema: *Sema, block: *Block, ptr: Air.Inst.Ref, len: u64) !A |
| 25630 | 25630 | return block.addBitCast(new_ty, non_slice_ptr); |
| 25631 | 25631 | } |
| 25632 | 25632 | |
| 25633 | fn zirMemcpy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void { | |
| 25634 | return sema.analyzeCopy(block, inst, .memcpy); | |
| 25635 | } | |
| 25636 | ||
| 25637 | fn zirMemmove(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void { | |
| 25638 | return sema.analyzeCopy(block, inst, .memmove); | |
| 25639 | } | |
| 25640 | ||
| 25641 | fn analyzeCopy( | |
| 25633 | fn zirMemcpy( | |
| 25642 | 25634 | sema: *Sema, |
| 25643 | 25635 | block: *Block, |
| 25644 | 25636 | inst: Zir.Inst.Index, |
| 25645 | op: enum { memcpy, memmove }, | |
| 25637 | air_tag: Air.Inst.Tag, | |
| 25638 | check_aliasing: bool, | |
| 25646 | 25639 | ) CompileError!void { |
| 25647 | 25640 | const inst_data = sema.code.instructions.items(.data)[@intFromEnum(inst)].pl_node; |
| 25648 | 25641 | const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data; |
| ... | ... | @@ -25659,12 +25652,12 @@ fn analyzeCopy( |
| 25659 | 25652 | const zcu = pt.zcu; |
| 25660 | 25653 | |
| 25661 | 25654 | if (dest_ty.isConstPtr(zcu)) { |
| 25662 | return sema.fail(block, dest_src, "cannot {s} to constant pointer", .{@tagName(op)}); | |
| 25655 | return sema.fail(block, dest_src, "cannot copy to constant pointer", .{}); | |
| 25663 | 25656 | } |
| 25664 | 25657 | |
| 25665 | 25658 | if (dest_len == .none and src_len == .none) { |
| 25666 | 25659 | const msg = msg: { |
| 25667 | const msg = try sema.errMsg(src, "unknown @{s} length", .{@tagName(op)}); | |
| 25660 | const msg = try sema.errMsg(src, "unknown copy length", .{}); | |
| 25668 | 25661 | errdefer msg.destroy(sema.gpa); |
| 25669 | 25662 | try sema.errNote(dest_src, msg, "destination type '{}' provides no length", .{ |
| 25670 | 25663 | dest_ty.fmt(pt), |
| ... | ... | @@ -25710,7 +25703,7 @@ fn analyzeCopy( |
| 25710 | 25703 | if (try sema.resolveDefinedValue(block, src_src, src_len)) |src_len_val| { |
| 25711 | 25704 | if (!(try sema.valuesEqual(dest_len_val, src_len_val, Type.usize))) { |
| 25712 | 25705 | const msg = msg: { |
| 25713 | const msg = try sema.errMsg(src, "non-matching @{s} lengths", .{@tagName(op)}); | |
| 25706 | const msg = try sema.errMsg(src, "non-matching copy lengths", .{}); | |
| 25714 | 25707 | errdefer msg.destroy(sema.gpa); |
| 25715 | 25708 | try sema.errNote(dest_src, msg, "length {} here", .{ |
| 25716 | 25709 | dest_len_val.fmtValueSema(pt, sema), |
| ... | ... | @@ -25730,11 +25723,7 @@ fn analyzeCopy( |
| 25730 | 25723 | |
| 25731 | 25724 | if (block.wantSafety()) { |
| 25732 | 25725 | const ok = try block.addBinOp(.cmp_eq, dest_len, src_len); |
| 25733 | const panic_id: Zcu.SimplePanicId = switch (op) { | |
| 25734 | .memcpy => .memcpy_len_mismatch, | |
| 25735 | .memmove => .memmove_len_mismatch, | |
| 25736 | }; | |
| 25737 | try sema.addSafetyCheck(block, src, ok, panic_id); | |
| 25726 | try sema.addSafetyCheck(block, src, ok, .copy_len_mismatch); | |
| 25738 | 25727 | } |
| 25739 | 25728 | } else if (dest_len != .none) { |
| 25740 | 25729 | if (try sema.resolveDefinedValue(block, dest_src, dest_len)) |dest_len_val| { |
| ... | ... | @@ -25762,11 +25751,6 @@ fn analyzeCopy( |
| 25762 | 25751 | return; |
| 25763 | 25752 | } |
| 25764 | 25753 | |
| 25765 | const check_aliasing = switch (op) { | |
| 25766 | .memcpy => true, | |
| 25767 | .memmove => false, | |
| 25768 | }; | |
| 25769 | ||
| 25770 | 25754 | const runtime_src = rs: { |
| 25771 | 25755 | const dest_ptr_val = try sema.resolveDefinedValue(block, dest_src, dest_ptr) orelse break :rs dest_src; |
| 25772 | 25756 | const src_ptr_val = try sema.resolveDefinedValue(block, src_src, src_ptr) orelse break :rs src_src; |
| ... | ... | @@ -25898,10 +25882,7 @@ fn analyzeCopy( |
| 25898 | 25882 | } |
| 25899 | 25883 | |
| 25900 | 25884 | _ = try block.addInst(.{ |
| 25901 | .tag = switch (op) { | |
| 25902 | .memcpy => .memcpy, | |
| 25903 | .memmove => .memmove, | |
| 25904 | }, | |
| 25885 | .tag = air_tag, | |
| 25905 | 25886 | .data = .{ .bin_op = .{ |
| 25906 | 25887 | .lhs = new_dest_ptr, |
| 25907 | 25888 | .rhs = new_src_ptr, |
| ... | ... | @@ -38153,9 +38134,8 @@ fn getExpectedBuiltinFnType(sema: *Sema, decl: Zcu.BuiltinDecl) CompileError!Typ |
| 38153 | 38134 | .@"panic.shiftRhsTooBig", |
| 38154 | 38135 | .@"panic.invalidEnumValue", |
| 38155 | 38136 | .@"panic.forLenMismatch", |
| 38156 | .@"panic.memcpyLenMismatch", | |
| 38137 | .@"panic.copyLenMismatch", | |
| 38157 | 38138 | .@"panic.memcpyAlias", |
| 38158 | .@"panic.memmoveLenMismatch", | |
| 38159 | 38139 | .@"panic.noreturnReturned", |
| 38160 | 38140 | => try pt.funcType(.{ |
| 38161 | 38141 | .param_types = &.{}, |
src/Zcu.zig+4-8| ... | ... | @@ -300,9 +300,8 @@ pub const BuiltinDecl = enum { |
| 300 | 300 | @"panic.shiftRhsTooBig", |
| 301 | 301 | @"panic.invalidEnumValue", |
| 302 | 302 | @"panic.forLenMismatch", |
| 303 | @"panic.memcpyLenMismatch", | |
| 303 | @"panic.copyLenMismatch", | |
| 304 | 304 | @"panic.memcpyAlias", |
| 305 | @"panic.memmoveLenMismatch", | |
| 306 | 305 | @"panic.noreturnReturned", |
| 307 | 306 | |
| 308 | 307 | VaList, |
| ... | ... | @@ -378,9 +377,8 @@ pub const BuiltinDecl = enum { |
| 378 | 377 | .@"panic.shiftRhsTooBig", |
| 379 | 378 | .@"panic.invalidEnumValue", |
| 380 | 379 | .@"panic.forLenMismatch", |
| 381 | .@"panic.memcpyLenMismatch", | |
| 380 | .@"panic.copyLenMismatch", | |
| 382 | 381 | .@"panic.memcpyAlias", |
| 383 | .@"panic.memmoveLenMismatch", | |
| 384 | 382 | .@"panic.noreturnReturned", |
| 385 | 383 | => .func, |
| 386 | 384 | }; |
| ... | ... | @@ -446,9 +444,8 @@ pub const SimplePanicId = enum { |
| 446 | 444 | shift_rhs_too_big, |
| 447 | 445 | invalid_enum_value, |
| 448 | 446 | for_len_mismatch, |
| 449 | memcpy_len_mismatch, | |
| 447 | copy_len_mismatch, | |
| 450 | 448 | memcpy_alias, |
| 451 | memmove_len_mismatch, | |
| 452 | 449 | noreturn_returned, |
| 453 | 450 | |
| 454 | 451 | pub fn toBuiltin(id: SimplePanicId) BuiltinDecl { |
| ... | ... | @@ -471,9 +468,8 @@ pub const SimplePanicId = enum { |
| 471 | 468 | .shift_rhs_too_big => .@"panic.shiftRhsTooBig", |
| 472 | 469 | .invalid_enum_value => .@"panic.invalidEnumValue", |
| 473 | 470 | .for_len_mismatch => .@"panic.forLenMismatch", |
| 474 | .memcpy_len_mismatch => .@"panic.memcpyLenMismatch", | |
| 471 | .copy_len_mismatch => .@"panic.copyLenMismatch", | |
| 475 | 472 | .memcpy_alias => .@"panic.memcpyAlias", |
| 476 | .memmove_len_mismatch => .@"panic.memmoveLenMismatch", | |
| 477 | 473 | .noreturn_returned => .@"panic.noreturnReturned", |
| 478 | 474 | // zig fmt: on |
| 479 | 475 | }; |
src/codegen/c.zig+3-15| ... | ... | @@ -3348,8 +3348,8 @@ fn genBodyInner(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, |
| 3348 | 3348 | .atomic_load => try airAtomicLoad(f, inst), |
| 3349 | 3349 | .memset => try airMemset(f, inst, false), |
| 3350 | 3350 | .memset_safe => try airMemset(f, inst, true), |
| 3351 | .memcpy => try airMemcpy(f, inst), | |
| 3352 | .memmove => try airMemmove(f, inst), | |
| 3351 | .memcpy => try airMemcpy(f, inst, "memcpy("), | |
| 3352 | .memmove => try airMemcpy(f, inst, "memmove("), | |
| 3353 | 3353 | .set_union_tag => try airSetUnionTag(f, inst), |
| 3354 | 3354 | .get_union_tag => try airGetUnionTag(f, inst), |
| 3355 | 3355 | .clz => try airUnBuiltinCall(f, inst, air_datas[@intFromEnum(inst)].ty_op.operand, "clz", .bits), |
| ... | ... | @@ -6976,15 +6976,7 @@ fn airMemset(f: *Function, inst: Air.Inst.Index, safety: bool) !CValue { |
| 6976 | 6976 | return .none; |
| 6977 | 6977 | } |
| 6978 | 6978 | |
| 6979 | fn airMemcpy(f: *Function, inst: Air.Inst.Index) !CValue { | |
| 6980 | return copyOp(f, inst, .memcpy); | |
| 6981 | } | |
| 6982 | ||
| 6983 | fn airMemmove(f: *Function, inst: Air.Inst.Index) !CValue { | |
| 6984 | return copyOp(f, inst, .memmove); | |
| 6985 | } | |
| 6986 | ||
| 6987 | fn copyOp(f: *Function, inst: Air.Inst.Index, op: enum { memcpy, memmove }) !CValue { | |
| 6979 | fn airMemcpy(f: *Function, inst: Air.Inst.Index, function_paren: []const u8) !CValue { | |
| 6988 | 6980 | const pt = f.object.dg.pt; |
| 6989 | 6981 | const zcu = pt.zcu; |
| 6990 | 6982 | const bin_op = f.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; |
| ... | ... | @@ -6999,10 +6991,6 @@ fn copyOp(f: *Function, inst: Air.Inst.Index, op: enum { memcpy, memmove }) !CVa |
| 6999 | 6991 | try writeArrayLen(f, writer, dest_ptr, dest_ty); |
| 7000 | 6992 | try writer.writeAll(" != 0) "); |
| 7001 | 6993 | } |
| 7002 | const function_paren = switch (op) { | |
| 7003 | .memcpy => "memcpy(", | |
| 7004 | .memmove => "memmove(", | |
| 7005 | }; | |
| 7006 | 6994 | try writer.writeAll(function_paren); |
| 7007 | 6995 | try writeSliceOrPtr(f, writer, dest_ptr, dest_ty); |
| 7008 | 6996 | try writer.writeAll(", "); |
test/cases/compile_errors/bad_panic_call_signature.zig+3-2| ... | ... | @@ -27,9 +27,10 @@ pub const panic = struct { |
| 27 | 27 | pub const shiftRhsTooBig = simple_panic.shiftRhsTooBig; |
| 28 | 28 | pub const invalidEnumValue = simple_panic.invalidEnumValue; |
| 29 | 29 | pub const forLenMismatch = simple_panic.forLenMismatch; |
| 30 | pub const memcpyLenMismatch = simple_panic.memcpyLenMismatch; | |
| 30 | /// Delete after next zig1.wasm update | |
| 31 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 32 | pub const copyLenMismatch = simple_panic.copyLenMismatch; | |
| 31 | 33 | pub const memcpyAlias = simple_panic.memcpyAlias; |
| 32 | pub const memmoveLenMismatch = simple_panic.memmoveLenMismatch; | |
| 33 | 34 | pub const noreturnReturned = simple_panic.noreturnReturned; |
| 34 | 35 | }; |
| 35 | 36 |
test/cases/compile_errors/bad_panic_generic_signature.zig+3-2| ... | ... | @@ -23,9 +23,10 @@ pub const panic = struct { |
| 23 | 23 | pub const shiftRhsTooBig = simple_panic.shiftRhsTooBig; |
| 24 | 24 | pub const invalidEnumValue = simple_panic.invalidEnumValue; |
| 25 | 25 | pub const forLenMismatch = simple_panic.forLenMismatch; |
| 26 | pub const memcpyLenMismatch = simple_panic.memcpyLenMismatch; | |
| 26 | /// Delete after next zig1.wasm update | |
| 27 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 28 | pub const copyLenMismatch = simple_panic.copyLenMismatch; | |
| 27 | 29 | pub const memcpyAlias = simple_panic.memcpyAlias; |
| 28 | pub const memmoveLenMismatch = simple_panic.memmoveLenMismatch; | |
| 29 | 30 | pub const noreturnReturned = simple_panic.noreturnReturned; |
| 30 | 31 | }; |
| 31 | 32 |
test/cases/compile_errors/incorrect_type_to_memset_memcpy.zig+6-6| ... | ... | @@ -66,29 +66,29 @@ pub export fn memset_array() void { |
| 66 | 66 | // backend=stage2 |
| 67 | 67 | // target=native |
| 68 | 68 | // |
| 69 | // :5:5: error: unknown @memcpy length | |
| 69 | // :5:5: error: unknown copy length | |
| 70 | 70 | // :5:18: note: destination type '[*]u8' provides no length |
| 71 | 71 | // :5:24: note: source type '[*]const u8' provides no length |
| 72 | 72 | // :10:13: error: type '*u8' is not an indexable pointer |
| 73 | 73 | // :10:13: note: operand must be a slice, a many pointer or a pointer to an array |
| 74 | 74 | // :15:13: error: type '*u8' is not an indexable pointer |
| 75 | 75 | // :15:13: note: operand must be a slice, a many pointer or a pointer to an array |
| 76 | // :20:5: error: non-matching @memcpy lengths | |
| 76 | // :20:5: error: non-matching copy lengths | |
| 77 | 77 | // :20:13: note: length 6 here |
| 78 | 78 | // :20:20: note: length 5 here |
| 79 | 79 | // :24:13: error: cannot memset constant pointer |
| 80 | // :29:13: error: cannot memcpy to constant pointer | |
| 80 | // :29:13: error: cannot copy to constant pointer | |
| 81 | 81 | // :33:13: error: type '[5]u8' is not an indexable pointer |
| 82 | 82 | // :33:13: note: operand must be a slice, a many pointer or a pointer to an array |
| 83 | // :39:5: error: unknown @memmove length | |
| 83 | // :39:5: error: unknown copy length | |
| 84 | 84 | // :39:19: note: destination type '[*]u8' provides no length |
| 85 | 85 | // :39:25: note: source type '[*]const u8' provides no length |
| 86 | 86 | // :44:14: error: type '*u8' is not an indexable pointer |
| 87 | 87 | // :44:14: note: operand must be a slice, a many pointer or a pointer to an array |
| 88 | // :49:5: error: non-matching @memmove lengths | |
| 88 | // :49:5: error: non-matching copy lengths | |
| 89 | 89 | // :49:14: note: length 6 here |
| 90 | 90 | // :49:21: note: length 5 here |
| 91 | // :54:14: error: cannot memmove to constant pointer | |
| 91 | // :54:14: error: cannot copy to constant pointer | |
| 92 | 92 | // :58:14: error: type '[5]u8' is not an indexable pointer |
| 93 | 93 | // :58:14: note: operand must be a slice, a many pointer or a pointer to an array |
| 94 | 94 | // :62:13: error: type '[5]u8' is not an indexable pointer |
test/cases/safety/memcpy_len_mismatch.zig+1-1| ... | ... | @@ -2,7 +2,7 @@ const std = @import("std"); |
| 2 | 2 | |
| 3 | 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { |
| 4 | 4 | _ = stack_trace; |
| 5 | if (std.mem.eql(u8, message, "@memcpy arguments have non-equal lengths")) { | |
| 5 | if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) { | |
| 6 | 6 | std.process.exit(0); |
| 7 | 7 | } |
| 8 | 8 | std.process.exit(1); |
test/cases/safety/memmove_len_mismatch.zig+1-1| ... | ... | @@ -2,7 +2,7 @@ const std = @import("std"); |
| 2 | 2 | |
| 3 | 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { |
| 4 | 4 | _ = stack_trace; |
| 5 | if (std.mem.eql(u8, message, "@memmove arguments have non-equal lengths")) { | |
| 5 | if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) { | |
| 6 | 6 | std.process.exit(0); |
| 7 | 7 | } |
| 8 | 8 | std.process.exit(1); |
test/incremental/change_panic_handler_explicit+9-6| ... | ... | @@ -37,9 +37,10 @@ pub const panic = struct { |
| 37 | 37 | pub const shiftRhsTooBig = no_panic.shiftRhsTooBig; |
| 38 | 38 | pub const invalidEnumValue = no_panic.invalidEnumValue; |
| 39 | 39 | pub const forLenMismatch = no_panic.forLenMismatch; |
| 40 | pub const memcpyLenMismatch = no_panic.memcpyLenMismatch; | |
| 40 | /// Delete after next zig1.wasm update | |
| 41 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 42 | pub const copyLenMismatch = no_panic.copyLenMismatch; | |
| 41 | 43 | pub const memcpyAlias = no_panic.memcpyAlias; |
| 42 | pub const memmoveLenMismatch = no_panic.memmoveLenMismatch; | |
| 43 | 44 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 44 | 45 | }; |
| 45 | 46 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| ... | ... | @@ -85,9 +86,10 @@ pub const panic = struct { |
| 85 | 86 | pub const shiftRhsTooBig = no_panic.shiftRhsTooBig; |
| 86 | 87 | pub const invalidEnumValue = no_panic.invalidEnumValue; |
| 87 | 88 | pub const forLenMismatch = no_panic.forLenMismatch; |
| 88 | pub const memcpyLenMismatch = no_panic.memcpyLenMismatch; | |
| 89 | /// Delete after next zig1.wasm update | |
| 90 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 91 | pub const copyLenMismatch = no_panic.copyLenMismatch; | |
| 89 | 92 | pub const memcpyAlias = no_panic.memcpyAlias; |
| 90 | pub const memmoveLenMismatch = no_panic.memmoveLenMismatch; | |
| 91 | 93 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 92 | 94 | }; |
| 93 | 95 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| ... | ... | @@ -133,9 +135,10 @@ pub const panic = struct { |
| 133 | 135 | pub const shiftRhsTooBig = no_panic.shiftRhsTooBig; |
| 134 | 136 | pub const invalidEnumValue = no_panic.invalidEnumValue; |
| 135 | 137 | pub const forLenMismatch = no_panic.forLenMismatch; |
| 136 | pub const memcpyLenMismatch = no_panic.memcpyLenMismatch; | |
| 138 | /// Delete after next zig1.wasm update | |
| 139 | pub const memcpyLenMismatch = copyLenMismatch; | |
| 140 | pub const copyLenMismatch = no_panic.copyLenMismatch; | |
| 137 | 141 | pub const memcpyAlias = no_panic.memcpyAlias; |
| 138 | pub const memmoveLenMismatch = no_panic.memmoveLenMismatch; | |
| 139 | 142 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 140 | 143 | }; |
| 141 | 144 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { |