From 7bd3207921b3db0b329c397c4dac8b25bd713ff3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 27 Apr 2025 12:17:59 -0700 Subject: make `@memcpy` and `@memmove` share panic handlers --- lib/std/debug/no_panic.zig | 10 ++++------ lib/std/debug/simple_panic.zig | 11 +++++------ 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'lib/std/debug') diff --git a/lib/std/debug/no_panic.zig b/lib/std/debug/no_panic.zig index ccecc89a87..0a4996097a 100644 --- a/lib/std/debug/no_panic.zig +++ b/lib/std/debug/no_panic.zig @@ -125,17 +125,15 @@ pub fn forLenMismatch() noreturn { @trap(); } -pub fn memcpyLenMismatch() noreturn { - @branchHint(.cold); - @trap(); -} +/// Delete after next zig1.wasm update +pub const memcpyLenMismatch = copyLenMismatch; -pub fn memcpyAlias() noreturn { +pub fn copyLenMismatch() noreturn { @branchHint(.cold); @trap(); } -pub fn memmoveLenMismatch() noreturn { +pub fn memcpyAlias() noreturn { @branchHint(.cold); @trap(); } diff --git a/lib/std/debug/simple_panic.zig b/lib/std/debug/simple_panic.zig index 724061021f..568f7de495 100644 --- a/lib/std/debug/simple_panic.zig +++ b/lib/std/debug/simple_panic.zig @@ -120,18 +120,17 @@ pub fn forLenMismatch() noreturn { call("for loop over objects with non-equal lengths", null); } -pub fn memcpyLenMismatch() noreturn { - call("@memcpy arguments have non-equal lengths", null); +/// Delete after next zig1.wasm update +pub const memcpyLenMismatch = copyLenMismatch; + +pub fn copyLenMismatch() noreturn { + call("source and destination have non-equal lengths", null); } pub fn memcpyAlias() noreturn { call("@memcpy arguments alias", null); } -pub fn memmoveLenMismatch() noreturn { - call("@memmove arguments have non-equal lengths", null); -} - pub fn noreturnReturned() noreturn { call("'noreturn' function returned", null); } -- cgit v1.2.3