aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-04-28 15:06:18 -0400
committerGitHub <noreply@github.com>2025-04-28 15:06:18 -0400
commit8facd99d41b1290f9b29ec22c9dcce680d972810 (patch)
tree0ab61812da58df4127b8b56ec43eb88c0e6d5eb2 /lib
parentd038676a1f46ecab2bd095d3503ab05bcd8de58c (diff)
parent8be4511061f18e1bf2b6f7bf108482c6d1e30aa6 (diff)
downloadzig-8facd99d41b1290f9b29ec22c9dcce680d972810.tar.gz
zig-8facd99d41b1290f9b29ec22c9dcce680d972810.zip
Merge pull request #23708 from ziglang/memmove-followups
`@memmove` followups
Diffstat (limited to 'lib')
-rw-r--r--lib/std/debug.zig10
-rw-r--r--lib/std/debug/no_panic.zig10
-rw-r--r--lib/std/debug/simple_panic.zig11
-rw-r--r--lib/std/zig/Zir.zig6
4 files changed, 16 insertions, 21 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 722bcc74a9..d2b17ed30d 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -126,18 +126,16 @@ pub fn FullPanic(comptime panicFn: fn ([]const u8, ?usize) noreturn) type {
@branchHint(.cold);
call("for loop over objects with non-equal lengths", @returnAddress());
}
- pub fn memcpyLenMismatch() noreturn {
+ /// Delete after next zig1.wasm update
+ pub const memcpyLenMismatch = copyLenMismatch;
+ pub fn copyLenMismatch() noreturn {
@branchHint(.cold);
- call("@memcpy arguments have non-equal lengths", @returnAddress());
+ call("source and destination arguments have non-equal lengths", @returnAddress());
}
pub fn memcpyAlias() noreturn {
@branchHint(.cold);
call("@memcpy arguments alias", @returnAddress());
}
- pub fn memmoveLenMismatch() noreturn {
- @branchHint(.cold);
- call("@memmove arguments have non-equal lengths", @returnAddress());
- }
pub fn noreturnReturned() noreturn {
@branchHint(.cold);
call("'noreturn' function returned", @returnAddress());
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);
}
diff --git a/lib/std/zig/Zir.zig b/lib/std/zig/Zir.zig
index d40322f51f..bc86ca6885 100644
--- a/lib/std/zig/Zir.zig
+++ b/lib/std/zig/Zir.zig
@@ -983,12 +983,12 @@ pub const Inst = struct {
/// Implements the `@memcpy` builtin.
/// Uses the `pl_node` union field with payload `Bin`.
memcpy,
- /// Implements the `@memset` builtin.
- /// Uses the `pl_node` union field with payload `Bin`.
- memset,
/// Implements the `@memmove` builtin.
/// Uses the `pl_node` union field with payload `Bin`.
memmove,
+ /// Implements the `@memset` builtin.
+ /// Uses the `pl_node` union field with payload `Bin`.
+ memset,
/// Implements the `@min` builtin for 2 args.
/// Uses the `pl_node` union field with payload `Bin`
min,