7177 Commits

Author SHA1 Message Date
Isaac Freund
a2f54fce53 std.Build.Step.Run: add stdin to cache manifest 2023-06-16 05:35:30 +00:00
Dumitru Stavila
1253d591be target.zig adds ps4 and ps5 type sizes. 2023-06-15 11:23:04 -07:00
Eric Joldasov
610b02c432 std.atomic.Atomic: update tests to new for-loop syntax, re-enable test with isel
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-14 18:25:56 -07:00
Marcos O
ff835cce10
windows.sendto fix (#15831) 2023-06-14 16:24:16 +00:00
Andrew Kelley
38fc826a5a
Merge pull request #15957 from BratishkaErik/deprecated-
std.*: remove stuff that was deprecated in older versions
2023-06-13 14:53:41 -07:00
Niles Salter
700ea694b2
Fix pdqSort+heapSort for ranges besides 0..len (#15982) 2023-06-13 16:55:58 -04:00
Evin Yulo
129afba460 publicize std.rand.ziggurat 2023-06-13 11:29:28 -07:00
Lee Cannon
21c258acac allow run step to skip foreign binary execution if executor fails 2023-06-13 11:27:45 -07:00
Frank Denis
cc708b4a88
crypto.pcurves: don't assume that points with X=0 are at infinity (#16017)
There's also a valid point with X=0 on each curves.

Fixes #16015
2023-06-13 18:20:24 +00:00
Evin Yulo
137b115681 os.connect: mark ECONNABORTED as unreachable
closes #13677
2023-06-13 11:16:09 -07:00
Jan200101
d7b73af8f6 Never implicitly add rpaths for each lib dir, add NixOS libdir to rpath 2023-06-13 11:11:10 -07:00
Zapolsky Anton
c76ce25a61
Remove CheckObjectStep.runAndCompare (#15973)
Closes #14969
2023-06-13 14:09:24 -04:00
Evin Yulo
854f26ad8a fix typo in std.Uri 2023-06-13 10:58:11 -07:00
bfredl
4f914c8414 bpf: expose "syscall" program type and F_SLEEPABLE flag 2023-06-13 10:57:51 -07:00
dweiller
28eed1f7b3 std.mem.ValidationAllocator: forward free() calls
Failing to forward free calls to the underlying allocator makes
`ValidationAllocator` unusable for testing allocators while checking for
leaks. This change allows allocators that wrap `std.testing.allocator`
to be tested with `std.heap.testAllocator()` in test decls without
reporting erroneous leaks.
2023-06-13 10:57:11 -07:00
Andrew Kelley
8cf72cdfb1
Merge pull request #15985 from erikarvstedt/fix-arena-alloc
arena_allocator/reset: fix use after free, fix buffer overrun
2023-06-13 10:52:41 -07:00
Eric Joldasov
d884d7050e
all: replace comptime try with try comptime
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00
Eric Joldasov
6078781ae5
std.Build.Step.Compile: remove addSystemIncludeDir, addIncludeDir, addLibPath, and addFrameworkDir (deprecated in 0.10)
Followup to d3d24874c91054a70c706fed47278c81c9ce890a.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00
Eric Joldasov
4936453d56
std.builtin: remove TypeInfo and Type.FnArg (deprecated in 0.10)
Followup to d3d24874c91054a70c706fed47278c81c9ce890a.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00
Eric Joldasov
4d5fb62a82
std.crypto.sign.Ed25519: remove sign, verify, key_blinding.sign, and
`key_blinding.unblindPublicKey` (deprecated in 0.10)

Followup to 9c0d975a099387cd2b47e527892e71ae1601eaf4.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00
Eric Joldasov
f7dddd4c81
std.debug: remove warn (deprecated in 0.9)
Followup to 902df103c6151c257c90de9ba5f29f7f4b9dbea2.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00
Eric Joldasov
ee821b2d7f
std.fmt: remove e, E, z, and Z specifiers (deprecated in 0.8)
Followup to cd7c870bd81391dd97c5c75eb3910382ba7280a1.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:56 +06:00
Eric Joldasov
53fc991abd
std.fmt.formatValue: remove B and Bi specifiers (deprecated in 0.8)
Followup to 72664df4911f5d5bddead48acde6275f1d5f2a5e.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:45:12 +06:00
Eric Joldasov
c46e5eb3e1
std.fifo.LinearFifo: remove ensureCapacity (deprecated in 0.9)
Followup to 902df103c6151c257c90de9ba5f29f7f4b9dbea2.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:45:12 +06:00
Eric Joldasov
b0ad1c86da
std.io: remove FindByteOutStream and findByteOutStream (deprecated in
0.9)

Followup to 902df103c6151c257c90de9ba5f29f7f4b9dbea2.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:45:12 +06:00
Eric Joldasov
e92dab14f9
std.meta: remove TagType (deprecated in 0.9)
Followup to 902df103c6151c257c90de9ba5f29f7f4b9dbea2.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:45:12 +06:00
Eric Joldasov
d04a262a3d
std.math: hard deprecate obsolete constants (soft deprecated in 0.10)
Followup to 5b8ac9821dd25c3e5282130b4d93d6c5b7debb08.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:45:12 +06:00
Eric Joldasov
eb4439f1e4
std.meta: remove Vector (deprecated in 0.10)
Followup to d42d31f72f38165f70c2850e9cc63da44b3b470c.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:45:08 +06:00
Erik Arvstedt
89bd29a905 arena_allocator/reset: avoid zero-capacity allocations
1. When the arena is already empty, resetting with `retain_capacity` no longer
   results in allocating a buffer with zero capacity.
   This behavior was previously intended by the `(current_capacity == 0)` check,
   but wasn't correctly implemented.

2. Resetting with `.{ .retain_with_limit = 0 }` is now equivalent to
   `free_all` and a new buffer with zero capacity is no longer created.
   This is a useful side-effect of the above fixes.
2023-06-13 09:48:51 +02:00
Erik Arvstedt
5d3c8f4913 arena_allocator/reset: fix use after free
Previously, when the last buffer in `buffer_list` was retained after
deleting all other buffers, `buffer_list` wasn't updated and pointed
to a deleted buffer.
2023-06-13 09:48:51 +02:00
Erik Arvstedt
41430a366f arena_allocator/reset: fix buffer overrun
Previously, the buffer reserved with `retain_with_limit` was missing
space for the `BufNode`.

When the user-provided a limit that was smaller than `@sizeOf(BufNode)`,
`reset` would store a new `BufNode` in an allocation smaller than
`BufNode`, leading to a buffer overrun.
2023-06-13 09:46:16 +02:00
mlugg
52e7934a21 std.dwarf: fix findCompileUnit when ranges offset is given by const 2023-06-12 14:22:45 -07:00
mlugg
9e61ba19e9 std.crypto.tls.Client: fix @memcpy crash in limitedOverlapCopy
Resolves: #15928
2023-06-12 14:22:09 -07:00
Andrew Kelley
ab86b20248 std.hash: improve small-key hashing in Wyhash
Instead of carrying an optimized version of wyhash in the compiler for
small keys, put it into the std lib where it belongs.

...except it does not match the official test cases. This will need to
be fixed before merging into master. This is an extremely
contributor-friendly task.

Related issue: #15916
2023-06-10 20:51:09 -07:00
Jacob Young
04e66e6b4d InternPool: add optional coercion 2023-06-10 20:47:59 -07:00
Andrew Kelley
34dae73005 std.hash: auto hash signed ints as bitcasts of unsigned ints 2023-06-10 20:47:58 -07:00
Jacob Young
dc18739a73 process: add more missing const 2023-06-10 20:47:58 -07:00
Jacob Young
cab79b0877 lib: add const to avoid regression
Not sure if this was meant to be legal or not, but either way this code
should have been using const anyway.
2023-06-10 20:47:58 -07:00
Jacob Young
26fac15f48 math.big.int: fix ctz of zero 2023-06-10 20:47:57 -07:00
Andrew Kelley
c7d65fa368 std.hash: add xxhash to benchmark and fix its API 2023-06-10 20:47:57 -07:00
Jacob Young
a803e9cf48 Sema: fix vector comparison and interning of -0 2023-06-10 20:47:57 -07:00
Jacob Young
6e0de1d116 InternPool: port most of value tags 2023-06-10 20:47:54 -07:00
Andrew Kelley
1b64eed107 remove the kludges from std.builtin
I added these in an earlier commit in this branch. This commit removes
them before the branch is merged.
2023-06-10 20:47:54 -07:00
Andrew Kelley
17882162b3 stage2: move function types to InternPool 2023-06-10 20:47:53 -07:00
Andrew Kelley
88dbd62bcb stage2: move enum tag values into the InternPool
I'm seeing a new assertion trip: the call to `enumTagFieldIndex` in the
implementation of `@Type` is attempting to query the field index of an
union's enum tag, but the type of the enum tag value provided is not the
same as the union's tag type. Most likely this is a problem with type
coercion, since values are now typed.

Another problem is that I added some hacks in std.builtin because I
didn't see any convenient way to access them from Sema. That should
definitely be cleaned up before merging this branch.
2023-06-10 20:46:17 -07:00
Andrew Kelley
1c7095cb7d add std.hash.uint32
This is handy if you have a u32 and want a u32 and don't want to take a
detour through many layers of abstraction elsewhere in the std.hash
namespace.
Copied from https://nullprogram.com/blog/2018/07/31/
2023-06-10 20:42:30 -07:00
Andrew Kelley
70a4b76aca std.builtin.AddressSpace: allocate one more bit to this enum 2023-06-10 20:42:28 -07:00
Andrew Kelley
75cf06c187 std.mem.alignForwardGeneric: manually inline the assertions
This matches more directly the documentation comments, and makes it more
obvious what went wrong when an assertion fails.
2023-06-10 20:42:28 -07:00
Andrew Kelley
cac60a05a7 std.builtin: give some enums integer types 2023-06-10 20:40:03 -07:00
Jacob G-W
c842deea75 os/plan9: fix order of register setting in syscall1
We need to set rbp last because the arguments are stored on the
stack. If we clobber rbp first, then we will get a segfault when
trying to access the function arguments.

I believe I had already done this with the other syscall* functions,
but not with syscall1, so this allows single argument syscalls like
close to work.
2023-06-10 11:36:32 +03:00