Commit Graph

29124 Commits

Author SHA1 Message Date
Andrew Kelley
9eb4b14eb8 start the 0.12.2 release cycle 2024-06-06 16:20:07 -07:00
Andrew Kelley
b0ba8b728f Release 0.12.1 2024-06-06 16:19:30 -07:00
Andrew Kelley
404a057f77 disable failing IoUring test
tracked by #20212
2024-06-06 11:14:39 -07:00
Andrew Kelley
7a29161e8e Merge pull request #20000 from Frojdholm/fix-gpa-crash-when-deallocating-metadata
Fix GeneralPurposeAllocator crash when deallocating metadata
2024-06-06 10:46:28 -07:00
Andrew Kelley
236fb915cc seriously people, don't put "zig-" in your package names
related #20178
2024-06-06 10:46:11 -07:00
Michael Dusan
e9388fde64 ld.lld: fix -m option for big-endian arm/aarch64 2024-06-06 10:46:02 -07:00
Veikka Tuominen
46a28175b3 Merge pull request #20084 from Vexu/missing-errors
Add missing errors to `@ptrFromInt` and Signal calling convention validation
2024-06-06 10:45:10 -07:00
George Thayamkery
59dd7a0fbd not android check on std.debug.getContext
have_getcontext must be false for android, this makes sure that
std.debug.getContext wont call the non-existant function (and thus hit a
compileError)
2024-06-06 10:44:39 -07:00
expikr
0aeeff0d94 math.hypot: fix incorrect over/underflow behavior (#19472) 2024-06-06 10:44:28 -07:00
Tim Culverhouse
ce9d2eda73 init: clarify .paths usage in build.zig.zon
Clarify the usage of .paths in build.zig.zon. Follow the recommendation
of the comments to explicitly list paths by explicitly listing the paths
in the init project.
2024-06-06 10:44:15 -07:00
T. M
d6eac43a5b std: Avoid overflowing in the midpoint calculation in upperBound 2024-06-06 10:44:04 -07:00
Linus Groh
0039cb7ef2 std.Build.step.Compile: Fix lib{c,cpp} mixup in dependsOnSystemLibrary() 2024-06-06 10:43:54 -07:00
Matthew Lugg
88146ea704 std.process.Child: prevent racing children from inheriting one another's pipes
The added comment explains the issue here relatively well. The new
progress API made this bug obvious because it became visibly clear that
certain Compile steps were seemingly "hanging" until other steps
completed. As it turned out, these child processes had raced to spawn,
and hence one had inherited the other's stdio pipes, meaning the `poll`
call in `std.Build.Step.evalZigProcess` was not identifying the child
stdout as closed until an unrelated process terminated.
2024-06-06 10:43:14 -07:00
Jacob Young
6e469bc44d EnumMap: fix init 2024-06-06 10:41:03 -07:00
Andrew Kelley
2d4b264527 std autodocs server: don't trim all URLs
This is a partial revert of 6635360dbd.
2024-05-22 07:18:14 -07:00
Veikka Tuominen
95845ba2ac llvm: fix @wasmMemory{Size,Grow} for wasm64
Closes #19942
2024-05-22 07:17:50 -07:00
Jiacai Liu
4a09703f62 std-docs: use open for macOS. 2024-05-22 07:15:30 -07:00
Andrew Kelley
82908b525d Merge pull request #19987 from Frojdholm/fix-gpa-double-free-stack-traces
gpa: Fix GeneralPurposeAllocator double free stack traces
2024-05-22 07:05:17 -07:00
Wes Koerber
aba1dbc954 fix: incorrect field sizes in std.os.linux.ifmap 2024-05-22 07:04:56 -07:00
Andrew Kelley
6ce3c2423e Merge pull request #19926 from squeek502/windows-sdk-cachepath-registry
WindowsSdk: Fix finding the _Instances directory when it's not in the default location
2024-05-22 07:04:47 -07:00
Ronald Chen
52150b701c [std] Fixed bug missing optional for lpName param on CreateEventExW. fixes #19946
https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventexw
2024-05-22 07:04:35 -07:00
Dominic
869880adac astgen: fix result info for catch switch_block_err_union 2024-05-22 07:04:01 -07:00
190n
511aa28983 Do not run asserts for WASI alignment when not targeting WASI 2024-05-22 07:03:54 -07:00
Lucas Santos
e57c9c0931 Avoid unnecessary operation in PageAllocator.
There's no need to call `alignForward` before `VirtualAlloc`.
From [MSDN](https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc):
```
If the lpAddress parameter is NULL, this value is rounded up to the next page boundary
```
2024-05-22 07:03:25 -07:00
Abhinav Gupta
d37182383d ChildProcess: document StdIo behaviors (#17553)
Add some basic documentation for the different ChildProcess.StdIo
behaviors and the fields they affect.
2024-05-22 07:03:09 -07:00
Veikka Tuominen
1216050520 define an error set for std.io.tty.Config.setColor 2024-05-22 07:02:54 -07:00
Pyry Kovanen
8832314acf llvm: always include debug information for global variables 2024-05-22 07:02:27 -07:00
Karl Bohlmark
4616fb0937 fix integer overflow in IoUring buffer ring size calculation 2024-05-22 07:02:23 -07:00
Pavel Verigo
fa4a626fac std.compress.flate: fix panic when reading into empty buffer 2024-05-22 07:02:16 -07:00
Jacob Young
33c3bf0631 cmake: make static curses configurable
Not sure why this exists in the first place, but disabling it reduces
the required dependencies of a CI runner.
2024-05-22 07:01:21 -07:00
Jacob Young
2563d32425 fs: handle OBJECT_NAME_COLLISION in makeOpenPath
This fixes a race condition when two threads/processes try to
`makeOpenPath` the same path simultaneously.
2024-05-22 07:01:14 -07:00
mlugg
33809a0c53 InternPool: eliminate var_args_param_type
This was a "fake" type used to handle C varargs parameters, much like
generic poison. In fact, it is treated identically to generic poison in
all cases other than one (the final coercion of a call argument), which
is trivially special-cased. Thus, it makes sense to remove this special
tag and instead use `generic_poison_type` in its place. This fixes
several bugs in Sema related to missing handling of this tag.

Resolves: #19781
2024-05-22 07:01:07 -07:00
Jacob Young
2648e3651e link: restore lost passthrough behavior
Fixes bug introduced by 3b5be9fb6e
2024-05-22 07:00:19 -07:00
Jacob Young
d09afc08da lld: use a response file on NameTooLong 2024-05-22 06:59:22 -07:00
Ryan Liptak
ddde99bdfa Build system: Allow specifying Win32 resource include paths using LazyPath
Adds an `include_paths` field to RcSourceFile that takes a slice of LazyPaths. The paths are resolved and subsequently appended to the -rcflags as `/I <resolved path>`.

This fixes an accidental regression from https://github.com/ziglang/zig/pull/19174. Before that PR, all Win32 resource compilation would inherit the CC flags (via `addCCArgs`), which included things like include directories. After that PR, though, that is no longer the case.

However, this commit intentionally does not restore the previous behavior (inheriting the C include paths). Instead, each .rc file will need to have its include paths specified directly and the include paths only apply to one particular resource script. This allows more fine-grained control and has less potentially surprising behavior (at the cost of some convenience).

Closes #19605
2024-05-22 06:58:09 -07:00
reokodoku
f2110b0c0d Change std.os to std.posix in error messages 2024-05-22 06:57:16 -07:00
Anton Lilja
7ce03acb9d LLVM: Fix panic when using tagged union backed by enum with negative values 2024-05-22 06:56:49 -07:00
Antonio Gomes
c3aa32e984 Sema: Don't generate runtime instructions on zirSplat if dest_ty doesn't have runtime bits 2024-05-22 06:56:30 -07:00
Igor Anić
efe06c5f31 std.tar: fix finding tar root_dir (#19829)
For issue #19820.
2024-05-01 12:05:29 -07:00
Jacob Young
7b908cb024 cbe: fix ub with integer @abs 2024-05-01 12:05:25 -07:00
Andrew Kelley
16d3f7b2fa std.Build.Step.CheckObject: fix parseDumpNames
This function incorrectly assumed that module name subsections, function
name subsections, and local name subsections are encoded the same,
however according to
[the specification](https://webassembly.github.io/spec/core/appendix/custom.html)
they are encoded differently.

This commit adds support for parsing module name subsections correctly,
which started appearing after upgrading to LLVM 18.
2024-05-01 12:05:20 -07:00
Andrew Kelley
fa5011aa31 C backend: avoid memcpy when len=0
As of Clang 18, calling memcpy() with a misaligned pointer trips UBSAN,
even if the length is zero. This unfortunately includes any call to
`@memcpy` when source or destination are undefined and the length is
zero.

This patch makes the C backend avoid calling memcpy when the length is
zero, thereby avoiding undefined behavior.

A zig1.wasm update will be needed in the llvm18 branch to activate this
code.
2024-05-01 12:05:12 -07:00
Alain Greppin
595a7f8b08 NetBSD: avoid ldd error on executables. zig cc produce 4 PT_LOAD segments,
wheras on NetBSD, only 2 PT_LOAD are usually produced by other compilers
(tested with host gcc and clang).

    $ ldd -v main_4segs
    .../main_4segs: wrong number of segments (4 != 2)
    .../main_4segs: invalid ELF class 2; expected 1
2024-05-01 12:05:05 -07:00
daurnimator
6c482b8033 test/link/glibc_compat: fix incorrect strlcpy result 2024-05-01 12:04:52 -07:00
Julian
ad63be7eb9 Sema+llvm: properly implement Interrupt callconv
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2024-05-01 12:04:44 -07:00
Alexandre Janon
704f8f4013 Fix ELF alignment for freestanding targets (#19766)
* Fix the ELF binaries for freestanding target created with the self-hosted linker.

    The ELF specification (generic ABI) states that ``loadable process segments must have congruent
    values for p_vaddr and p_offset, modulo the page size''. Linux refuses to load binaries that
    don't meet this requirement (execve() fails with EINVAL).
2024-05-01 12:04:19 -07:00
zhylmzr
ef9fb428b7 fix: object size error in archive 2024-05-01 12:04:03 -07:00
Andrew Kelley
600b652825 Merge pull request #19698 from squeek502/windows-batbadbut
std.process.Child: Mitigate arbitrary command execution vulnerability on Windows (BatBadBut)
2024-04-24 13:50:29 -07:00
Ryan Liptak
e36bf2baff windows.GetFinalPathNameByHandle: Support volumes mounted as paths
A volume can be mounted as a NTFS path, e.g. as C:\Mnt\Foo. In that case, IOCTL_MOUNTMGR_QUERY_POINTS gives us a mount point with a symlink value something like `\??\Volume{383da0b0-717f-41b6-8c36-00500992b58d}`. In order to get the `C:\Mnt\Foo` path, we can query the mountmgr again using IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH.

Fixes #19731
2024-04-24 13:45:36 -07:00
IntegratedQuantum
4babedf1be Clarify the blocking behavior of RwLock.lockShared(). (#19752) 2024-04-24 13:45:29 -07:00