26688 Commits

Author SHA1 Message Date
expikr
aecdf6ad50
Doc: elaborate on Slice section
somehow the concept of slices had less elaboration in its own dedicated section than the mentions of it elsewhere.
2023-10-27 23:11:56 +00:00
Andrew Kelley
1c85b0acbb
Merge pull request #17735 from ziglang/export-anon
link: support exporting constant values without a Decl
2023-10-27 15:20:13 -04:00
Linus Groh
772636ed0d
std.json: Parse -0 as a float instead of an integer (#17729)
This is consistent with `JSON.parse("-0")` in JavaScript, RFC 8259
doesn't specifically mention what to do in this case.
If a negative zero is encoded the intention is likely to preserve the
sign.
2023-10-27 18:05:51 +00:00
frmdstryr
a4cffd80bd Update slice_sentinel comment
Slice end can be omitted
2023-10-27 18:45:59 +03:00
frmdstryr
8dccd77277 Update comment on while
The @"while" is still used if cont expr is missing.
2023-10-27 18:45:24 +03:00
Jacob Young
3b0dce8ebd
Merge pull request #17716 from jacobly0/x86_64
x86_64: pass more tests
2023-10-27 08:29:24 -04:00
Travis Staloch
8f48533691 GenericReader error set fixes
add error.EndOfStream to readEnum() and isBytes() so that users can
catch these errors.  this also prevents them from panicing with
'invalid error value' on EndOfStream.

test both methods.
2023-10-27 05:50:33 -04:00
Andrew Kelley
29b05897a5
Merge pull request #17734 from joadnacer/iouring-update
std.linux: Update io_uring structs and consts for kernel 6.3.8
2023-10-27 04:44:25 -04:00
Nameless
87735e4dae std.http.Client: add proxy scheme guessing, fix typo
This adds scheme guessing when loading proxies, such that
`HTTP_PROXY=127.0.0.1` and such are valid now and it behaves identically
to `HTTP_PROXY=http://127.0.0.1`. Additionally fixed a typo that was
causing loadDefaultProxies to never populate the https_proxy.
2023-10-27 03:42:33 -04:00
Jacob Young
b0cf620fe3 x86_64: fix cond_br 2023-10-27 03:33:49 -04:00
Jacob Young
42bca3e2ee x86_64: fix @memset 2023-10-27 01:40:27 -04:00
Jacob Young
434a7db986 x86_64: add missing spill 2023-10-27 01:40:27 -04:00
Andrew Kelley
4bc88dd116 link: support exporting constant values without a Decl
The main motivating change here is to prevent the creation of a fake
Decl object by the frontend in order to `@export()` a value.

Instead, `link.updateDeclExports` is renamed to `link.updateExports` and
accepts a tagged union which can be either a Decl.Index or a
InternPool.Index.
2023-10-26 20:32:16 -07:00
Jacob Young
6ad22cd964 x86_64: add missing spills 2023-10-26 22:35:38 -04:00
Jacob Young
48526c0eb6 test: enable c-abi-tests for the x86_64 backend
Add testing for `x86_64_v2` and `x86_64_v3` with the x86_64 backend.
2023-10-26 21:45:58 -04:00
Jacob Young
98cd378208 x86_64: fix behavior of getValue
Old behavior renamed to `getValueIfFree`.
2023-10-26 21:45:58 -04:00
Jacob Young
3faa4ea959 main: enable debug modes in build scripts 2023-10-26 21:45:57 -04:00
Jacob Young
5e83441096 x86_64: implement @divFloor and @mod for i128 2023-10-26 21:45:57 -04:00
Andrew Kelley
ba9e38847a sema: remove source location logic in zirExportValue
`.unneeded` source location should never be passed when the source
location is in fact available.
2023-10-26 17:12:17 -07:00
joadnacer
28b848e3f0 std.io_uring: Improve splice implementation 2023-10-27 00:31:55 +01:00
joadnacer
0005e7e70b std.linux: Update io_uring structs and consts for kernel 6.3.8 2023-10-27 00:31:52 +01:00
Michael Dusan
da06269d70 std.target: bump some OS max versions
- freebsd, openbsd, macos, ios, watchos, tvos
2023-10-26 19:18:37 -04:00
Krzysztof Wolicki
a9e66ed730 Step.Options: @typeName gives a fully qualified name so the test needs to reflect that 2023-10-26 13:56:43 +03:00
Andrew Kelley
ba817fae8f
Merge pull request #17690
Sema: move remaining anon decls to new mechanism
2023-10-26 03:49:16 -04:00
Andrew Kelley
cf9735a5e0 link: Coff, MachO, and Wasm all had the same UAF bug 2023-10-25 20:24:05 -07:00
Andrew Kelley
098a07dc45 link.Elf: fix UAF in lowerAnonDecl
The main problem being fixed here is there was a getOrPut() that held on
to a reference to the value pointer too long, and meanwhile the call to
`lowerConst` ended up being recursive and mutating the hash map,
invoking undefined behavior.

caught via #17719
2023-10-25 19:57:02 -07:00
Andrew Kelley
cbcef2d806 C backend: remove some @as 2023-10-25 19:57:02 -07:00
Jacob Young
51f7e5412a cbe: update DeclGen.decl_index to support anon decls 2023-10-25 19:57:02 -07:00
Andrew Kelley
405ba2680f Sema: replace refValue with simpler implementation
Move some more anon decls to the new mechanism
2023-10-25 19:57:02 -07:00
Andrew Kelley
03b473d21b Sema: rework addConstantMaybeRef
and add anonDeclRef and migrate some anon decls to it
2023-10-25 19:57:02 -07:00
Andrew Kelley
f841b265c5 Sema: move @typeInfo anon decls to new mechanism 2023-10-25 19:57:02 -07:00
Andrew Kelley
426b5982d7 Sema: move some TODO comments to an issue
Tracking issue: #17689
2023-10-25 19:57:02 -07:00
Andrew Kelley
7a106645fd Sema: migrate @src to new anon decl mechanism 2023-10-25 19:57:02 -07:00
Jakub Konka
cc394431ae
Merge pull request #17699 from ziglang/elf-better-alloc
elf: allocated PHDR table always immediately succeeding the EHDR
2023-10-25 23:25:56 +02:00
Jakub Konka
10ea7accf7
Merge pull request #17706 from ziglang/elf-error-tests
elf: test error generation
2023-10-25 23:20:12 +02:00
frmdstryr
5c5d1f93c4 Update comment on for_range in Ast
The rhs can be omitted eg `0..`
2023-10-25 14:09:34 -04:00
Jacob Young
ed00afbc4c Coff: fix use after free 2023-10-25 12:23:21 -04:00
Jacob Young
868d592580 builtin: implement default_panic for plan9
Also disable default panic handler when not using elf.
2023-10-25 08:20:11 -04:00
Jakub Konka
bc081901dc Step.Compile: differentiate between fuzzy and exact matches for compile errors 2023-10-25 11:40:16 +02:00
Jacob Young
b55377a5ab x86_64: pass more tests
* 128-bit integer multiplication with overflow
 * more instruction encodings used by std inline asm
 * implement the `try_ptr` air instruction
 * follow correct stack frame abi
 * enable full panic handler
 * enable stack traces
2023-10-25 04:28:30 -04:00
Jakub Konka
030da45c8e elf: estimate max number of phdrs that can be emitted 2023-10-25 04:27:44 -04:00
Jakub Konka
e1248b693f elf: allocate PHDR table always succeeding the EHDR
While this is a less flexible approach to being able to
allocated the PHDR anywhere in file, it is sadly generally expected
by the tooling in the wild.
2023-10-25 04:27:44 -04:00
Jakub Konka
0a04bd87ba elf: use std.math.maxInt(u64) as signal that shdr/phdr not allocated yet 2023-10-25 04:27:44 -04:00
frmdstryr
f30ab46306 Update comment on Tag value assign_mod in Ast.zig 2023-10-25 09:31:27 +03:00
Nameless
6c9d34bce7
std.Uri: prevent crash with strange authority section 2023-10-25 09:30:24 +03:00
Jakub Konka
55c7a6d99d elf: test unknown file type error 2023-10-24 23:11:50 +02:00
Jakub Konka
bc9ab3a613 elf: test mismatched cpu architecture error 2023-10-24 22:48:55 +02:00
Jakub Konka
c9c210a4e7 elf: test path errors in ld script parsing 2023-10-24 22:31:25 +02:00
Jakub Konka
403e539669 elf: test unresolved symbol reference error 2023-10-24 22:08:36 +02:00
Jakub Konka
89563f07e3 build: match and ignore /?/ in expected compile errors 2023-10-24 22:08:36 +02:00