24589 Commits

Author SHA1 Message Date
John Zhang
e95fc2023f Change outdated filename in langref 2023-06-16 23:12:45 -07:00
Andrew Kelley
a10ddba921
Merge pull request #16064 from Luukdegram/wasm-linker
wasm/linker: symbol resolution improvements
2023-06-16 22:03:35 -07:00
Gregory Mullen
abfa215882 add additional errno (INTR) to tcset,getpgrp calls
Missed this originally because I was only able to trigger it when
SA_RESTART was missing from the sigaction handlers. I'm unconvinced this
is actually a sane way for stdlib to behave (see #15664). But this does
duplicate the existing behavior throughout os.zig which IMO should be
prioritized here.
2023-06-16 22:02:36 -07:00
Andrew Kelley
78c8cb4225
Merge pull request #16003 from g-w1/plan9-lazy-syms
Plan9: lots of fixes
2023-06-16 21:57:33 -07:00
Veikka Tuominen
0f5aff3441 zig build: add option to only print failed steps
The motivating case for this is that currently when a test fails
the CI log will include ~5k lines of listing steps that succeeded.
2023-06-16 15:17:59 -07:00
Andrew Kelley
537104fd9d
Merge pull request #16025 from mlugg/feat/remove-std-math-minmax
Consider bounds when refining @min/@max result type; deprecate std.math.{min,max,min3,max3}
2023-06-16 13:45:33 -07:00
mlugg
2af5bd8aa8 Autodoc: fix crash when walking @min/@max with two operands
This was causing CI failures after the previous commit.
2023-06-16 13:44:25 -07:00
r00ster91
2593156068 migration: std.math.{min, min3, max, max3} -> @min & @max 2023-06-16 13:44:09 -07:00
mlugg
22c6b6c9a9 Update zig1.wasm
This is needed in order to remove math.{min,max} from std in favour of
the builtins, since the builtins need the behavior fix from the previous
commit.

Note from Andrew: I updated this commit with zig1.wasm built by me.

Signed-off-by: Andrew Kelley <andrew@ziglang.org>
2023-06-16 13:43:32 -07:00
mlugg
c4cc796695 Sema: consider type bounds when refining result type of @min/@max
I achieved this through a major refactor of the logic of analyzeMinMax.
This change should be compatible with vectors of comptime_int, which
Andrew said are supposed to work (but which currently do not).
2023-06-16 13:33:31 -07:00
Luuk de Gram
44b322ce64
wasm-linker: correctly resolve undefined functions
We now resolve undefined symbols during incremental-compilation
where we discard the current symbol if we detect we found
an existing symbol which is not the one currently being updated.
The symbol will always be discarded in favor of the existing symbol
in such a case.
2023-06-16 17:16:56 +02:00
Luuk de Gram
e3db210cf1
wasm: support calling alias'd function pointers
When lowering a decl value we verify whether its owner decl index
equals to the decl index of the decl being lowered. When this is not
the case, we are lowering an alias. So instead, we will now lower
the owner decl instead and call its symbol to ensure its type
is being correctly generated.
2023-06-16 17:16:56 +02:00
Luuk de Gram
1cfad29f10
codegen: fix union padding
This regressed during the internpool merges. This commit
reinstates the padding logic for unions.
2023-06-16 17:16:56 +02:00
Luuk de Gram
098b0b50ab
wasm: fix lowerParentPtr offsets
The was incorrectly merged during internPool. This commit forward
fixes that and reinstates the correct logic.
2023-06-16 17:16:56 +02:00
Luuk de Gram
729f822e31
wasm-linker: correctly resolve exported symbols
When compiling Zig code using the Wasm backend, we would previously
incorrectly resolve exported symbols as it would not correctly remove
existing symbols if they were to be overwritten. This meant that
undefined symbols could cause collisions although they should be
resolved by the exported symbol.
2023-06-16 17:16:55 +02:00
Jacob G-W
5343a2f566 plan9: revamp the relocation system to allow decl refs 2023-06-16 08:34:30 -04:00
Jacob G-W
4dac9f54dd plan9: flesh out stdlib enough to allow not using simplified start logic 2023-06-16 08:34:30 -04:00
Jacob G-W
153def1460 Elf: fix memory leak with lazy symbols 2023-06-16 08:34:30 -04:00
Jacob G-W
9e8c7b104e Plan9: Add support for lazy symbols
This includes a renaming from DeclBlock to Atom.
2023-06-16 08:34:30 -04:00
Andrew Kelley
5d9e8f27d0
Merge pull request #16053 from ziglang/update-linux-headers
update linux kernel headers to 6.3.8
2023-06-15 23:58:05 -07:00
Isaac Freund
a2f54fce53 std.Build.Step.Run: add stdin to cache manifest 2023-06-16 05:35:30 +00:00
Jacob Young
2d6d2a1d11 cbe: add missing cast for @intToPtr values 2023-06-15 14:06:49 -07:00
Andrew Kelley
6bd93ef4eb update linux kernel headers to 6.3.8 2023-06-15 12:04:36 -07:00
Andrew Kelley
6946a26adc update-linux-headers: add loongarch and xtensa
These operating systems are newly supported by Zig since the last
linux-headers update.
2023-06-15 12:03:25 -07:00
Dumitru Stavila
1253d591be target.zig adds ps4 and ps5 type sizes. 2023-06-15 11:23:04 -07:00
Andrew Kelley
f5043ad6a3
Merge pull request #16042 from mlugg/fix/slice-len-comptime-mutation
Fix comptime mutation of slice len
2023-06-15 09:49:59 -07:00
mlugg
11d0dfb882 Sema: fix @intToPtr of zero value to optional pointer
Calling into coercion logic here is a little opaque, and more to the
point wholly unnecessary. Instead, the (very short) logic is now
implemented directly in Sema.

Resolves: #16033
2023-06-15 02:43:06 -07:00
mlugg
ce88c43a4e Sema: allow indexing tuple and vector pointers
Resolves: #13852
Resolves: #14705
2023-06-14 22:07:25 -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
mlugg
57f6e6729f
Sema: allow empty end index in zirSliceSentinel
This fixes a regression, and enables some related behavior tests which
were accidentally disabled.
2023-06-15 01:23:58 +01:00
mlugg
45e9617720
Sema: don't assume slice value is interned when loading from comptime pointer
Resolves: #16030
2023-06-15 01:23:52 +01:00
zooster
b975701a4d test/behavior/generics.zig: remove outdated TODO 2023-06-14 16:41:58 -07:00
Marcos O
ff835cce10
windows.sendto fix (#15831) 2023-06-14 16:24:16 +00:00
Andrew Kelley
496320d935
Merge pull request #15726 from mlugg/feat/peer-type-resolution-but-better
Sema: rewrite peer type resolution
2023-06-14 07:18:28 -07:00
jcalabro
666ae24816 Clarify @sin, @cos, @tan use radians 2023-06-14 06:04:52 -07: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
mlugg
8a92beb088
Sema: move all in-memory coercion logic to InternPool
Previously, this logic was split between Sema.coerceValueInMemory and
InternPool.getCoerced. This led to issues when trying to coerce e.g. an
optional containing an aggregate, because we'd call through to
InternPool's version which only recurses on itself so could not coerce
aggregates. Unifying them is fairly simple, and also simplified a bit of
logic in Sema.

Also fixes a key lifetime bug in aggregate coercion.
2023-06-13 21:48:21 +01:00
mlugg
588f45a0a1
Sema: allow in-memory coercion of tuples
This allows tuples whose fields are in-memory coercible to themselves be
coerced in memory. No InMemoryCoercionResult field has been added, so in
future one could be added to improve error messages.
2023-06-13 21:48:21 +01:00
mlugg
c9531eb833
Sema: rewrite peer type resolution
The existing logic for peer type resolution was quite convoluted and
buggy. This rewrite makes it much more resilient, readable, and
extensible. The algorithm works by first iterating over the types to
select a "strategy", then applying that strategy, possibly applying peer
resolution recursively.

Several new tests have been added to cover cases which the old logic did
not correctly handle.

Resolves: #15138
Resolves: #15644
Resolves: #15693
Resolves: #15709
Resolves: #15752
2023-06-13 21:48:18 +01: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