20934 Commits

Author SHA1 Message Date
Veikka Tuominen
b511231f95 Merge pull request #13338 from Vexu/stage2-compile-errors
Improve some error messages
2023-01-09 13:48:34 -07:00
Micah Switzer
8d95b713c5 Sema: resolve lazy align in zirReify for union fields
Closes #13435
2023-01-09 13:48:15 -07:00
Jacob Young
6165de9a61 Sema: make InferredErrorSet deterministic
Empirically, this `AutoHashMapUnmanaged` -> `AutoArrayHashMapUnmanaged`
change fixes all non-determinism in `ReleaseFast` build artifacts.

Closes #12183
2023-01-09 13:47:41 -07:00
Andrew Kelley
0848d33d78 Merge pull request #13430 from ziglang/stack-probe-msvc
Miscellaneous arm64 windows fixes
2023-01-09 13:47:09 -07:00
Yujiri
d8970de510 Add docstrings to some functions in std.meta 2023-01-09 13:46:58 -07:00
Frank Denis
72199c26b9 std.crypto.pwhash.bcrypt: inline the Feistel network function (#13416)
std/crypto/benchmark.zig results:

* Intel i5

before: 3.144 s/ops
 after: 1.922 s/ops

* Apple M1

before: 2.067 s/ops
 after: 1.373 s/ops
2023-01-09 13:46:46 -07:00
Nathan Bourgeois
ab4b538d91 Translate-C Remainder Macro Fix 2023-01-09 13:45:42 -07:00
Veikka Tuominen
a7b8d011a3 Merge pull request #13420 from jacobly0/c-backend
cbe: enough fixes to bootstrap a compiler with a working c backend
2023-01-09 13:45:06 -07:00
Frank Denis
ee8af8cffb std.crypto.ed25519 incremental signatures: hash the fallback noise (#13643)
If the noise parameter was null, we didn't use any noise at all.

We unconditionally generated random noise (`noise2`) but didn't use it.

Spotted by @cryptocode, thanks!
2022-12-22 23:06:28 +01:00
Cody Tapscott
3ee5cf627f stage2: Ensure f128 alignment matches c_longdouble alignment
On platforms where c_longdouble is 128-bits, interop with C code
is simplified by making f128 match the alignment of c_longdouble.

I intended to make this change as part of #13257, but I missed this
part.
2022-11-02 14:11:40 -07:00
Andrew Kelley
a0ac10d903 Merge pull request #13389 from jacobly0/fix-only-c
cbe: enough fixes for `-Donly-c` to be able to produce an executable
2022-11-02 14:11:31 -07:00
Andrew Kelley
5f11e341d8 Merge pull request #13396 from Luukdegram/fix-12880
llvm: mangle extern function names for Wasm target
2022-11-02 14:11:10 -07:00
Cody Tapscott
f354ad638a stage2 llvm: Respect alignment for .union_init
Resolves #13232.
2022-11-02 14:11:00 -07:00
Joachim Schmidt
99b1eaaac4 Merge pull request #13404 from joachimschmidt557/stage2-aarch64
stage2 aarch64: enable printing test results in the test runner
2022-11-02 14:10:52 -07:00
Jakub Konka
54bdc0108a cli: set sysroot when --sysroot option was passed
Fixes regression introduced in 0b47e69b7c
2022-11-02 14:10:16 -07:00
Andrew Kelley
57caec8585 Merge pull request #13368 from jacobly0/fix-aarch64-c 2022-11-02 14:09:45 -07:00
mnordine
5aa146c2d2 Fix variable name in documentation sample (#13391) 2022-11-02 14:09:30 -07:00
Frank Denis
5e4000ee69 ed25519: recommend using the seed to recover a key pair 2022-11-02 14:09:24 -07:00
Frank Denis
26e7d4c9a3 Ed25519.KeyPair.fromSecretKey() didn't compile after the API changes (#13386)
Fixes #13378
2022-11-02 14:09:18 -07:00
Andrew Kelley
f366f381f5 ci: add 0.10.0 release data 2022-11-02 14:08:18 -07:00
Andrew Kelley
455d583d30 stage2: fix compilation on 32-bit arm 2022-11-02 14:08:10 -07:00
Andrew Kelley
08b42705ab start the 0.10.x branch 2022-10-31 10:26:50 -07:00
Andrew Kelley
0c1701768d Release 0.10.0 0.10.0 2022-10-31 10:24:38 -07:00
Cody Tapscott
049e6025f2 stage2: Add explicit type qualifier to workaround #13366
Depending on how #13366 is resolved, this code should arguably have
been rejected with a compile error in the first place.
2022-10-31 13:13:11 -04:00
Cody Tapscott
6f2408aab8 link/MachO: Avoid depending on host PATH_MAX
Repeat of a4eb221b9 for the newly-synchronized zld code.

Restores ability to compile Zig for WASI.
2022-10-31 13:12:37 -04:00
Andrew Kelley
d02242661e std.heap: make wasm32 PageAllocator handle large allocation
When a number of bytes to be allocated is so great that alignForward()
is not possible, return `error.OutOfMemory`.

Companion commit to 3f3003097cbf5a6ad9e0dfc29b2cafbe2e35dded.
2022-10-30 19:28:26 -07:00
Andrew Kelley
ef761c2cbc
Merge pull request #13360 from topolarity/comptime-bool-binops
Make `x and false` and `x or true` comptime-known
2022-10-30 22:11:44 -04:00
Andrew Kelley
6d999abba0 mingw-w64: add gdiplus def files
closes #13192
2022-10-30 19:04:00 -07:00
Andrew Kelley
d4f668b241
Merge pull request #13361 from jacobly0/while-cont-scope
AstGen: avoid access to capture defined in an inner scope from a continue expression
2022-10-30 21:44:07 -04:00
Andrew Kelley
3e126102b7 compiler_rt: fix gnu_f16_abi for i386-windows
closes #13333
2022-10-30 18:42:59 -07:00
Andrew Kelley
30b8b29f88 re-apply "Fix C include files not being in whole cache (#11365)"
This reverts commit 06310e3d4eb47fed88b175891cb5865bb050f020, reapplying
commit a430630002bf02162ccbf8d3eb10fd73e490cefd.

I deeply apologize to @moosichu and those affected by this bug. The
original fix was actually fine. When I reverted it, I misremembered
how the Cache API works. I thought the fix was going to introduce
nondeterminism into the hash, but I forgot that the order of files in
the manifest doesn't actually matter when checking for a cache hit.

Actually, it does matter a little bit. This fix has a subtle downside
which is that it does introduce the possibility of false negatives when
checking for cache hits of 2+ iterations ago. For example, if the code
goes from "foo", to "bar", and then back to "foo", it may look like a
cache miss when it should have been a hit because 2 iterations ago the
code was the same. However, this is an uncommon use case, and all it
does is cause a bit of wasted time and disk space. That said, my
suggestion from earlier still applies and would be a nice follow-up
enhancement to this fix:

The proper solution to this is to, in whole cache mode, append the hash
inputs to some data structure, and then after the compilation is
complete, do some kind of sorting on the hash inputs so that they will
be the same order every time, then apply them in sequence. No lock on
the Cache object is needed for this scheme.

closes #11063
2022-10-30 17:04:09 -07:00
Andrew Kelley
a5c96c49d0 langref: mention void{} and empty blocks
closes #11112
closes #12496
2022-10-30 16:33:22 -07:00
Andrew Kelley
3f3003097c std.heap.PageAllocator: add check for large allocation
Instead of making the memory alignment functions more complicated, I
added more API documentation for their existing semantics.

closes #12118
closes #12135
2022-10-30 16:10:20 -07:00
Andrew Kelley
9b54c9dee8 zig test: forward target CLI args to zig run when using -ofmt=c
Previously, if you used `zig test -ofmt=c -target foobar` then Zig would
try to compile the generated C code with the native target instead of
"foobar".

With this change, `--test-cmd` with e.g. QEMU still won't work, but at
least the binary will get compiled for the correct target.
2022-10-30 15:44:58 -07:00
Jacob Young
a77d89afe3 behavior: enable fixed cbe tests 2022-10-30 15:38:50 -04:00
Jacob Young
01d76d419e Sema: avoid comptime null unwrap
This avoids a crash analyzing check_comptime_control_flow.
2022-10-30 15:38:46 -04:00
Cody Tapscott
ca332f57f7 stage2: Make x and false/x or true comptime-known
Same as preceding change, but for stage2.
2022-10-30 12:38:08 -07:00
Jacob Young
5c3a486639 AstGen: avoid accessing value from inner scope
While continue expressions can access the capture, so ensure that it is
unwrapped in an outer scope.
2022-10-30 15:25:58 -04:00
Cody Tapscott
2f732deb3d stage1: Make x and false/x or true comptime-known
We need to be careful to respect side-effects/branching in these
cases, but otherwise this behaves very similarly to multiplication.
`lhs and rhs == false` if either lhs or rhs is comptime-known `false`,
just like `lhs * rhs == 0` if either lhs or rhs is comptime-known to
be zero.

Similar reasoning applies to `lhs or rhs`.
2022-10-30 12:21:37 -07:00
Andrew Kelley
8caed48460 Merge branch 'ci-enable-aarch64-linux' 2022-10-30 12:09:40 -07:00
Nameless
40e84a27d6
change uefi packed structs to new integer backed syntax (#13173)
* std.os.uefi: integer backed structs, add tests to catch regressions

device_path_protocol now uses extern structs with align(1) fields because
the transition to integer backed packed struct broke alignment

added comptime asserts that device_path_protocol structs do not violate
alignment and size specifications
2022-10-30 15:08:32 -04:00
Loris Cro
1696434063
Merge pull request #13300 from jcalabro/master
Better Autodoc Src File Links
2022-10-30 17:20:57 +01:00
Loris Cro
d4487b6a2e autodoc: update to new func zir body structure
this is a hack meant to restore functionality for the upcoming release,
a proper analysis of the new zir structure is required to make a robust
change.
2022-10-30 17:17:34 +01:00
Jakub Konka
2b25d3c333
Merge pull request #13356 from ziglang/macho-no-dupe
macho: fix performance regression for x86_64 and -dead_strip
2022-10-30 16:38:28 +01:00
Andrew Kelley
17df35025b CI: disable failing C backend test
See #13357
2022-10-30 03:21:18 -07:00
Jakub Konka
9b0c555db4 macho: fix regression in dead strip for x86_64
Correctly handle calculating encompassing atoms for local
relocations (`r_extern == 0`).
2022-10-30 10:49:00 +01:00
Jakub Konka
27bcd4ec79 macho: do not unnecessarily dupe sym names in resolver 2022-10-30 10:12:25 +01:00
Andrew Kelley
5339cac2ef std: re-enable auto hash test
It was temporarily disabled due to a self-hosted compiler
miscompilation.

closes #12178
2022-10-30 01:09:31 -07:00
Andrew Kelley
fbd1390f80 CI: drone: shuffle some tests around
We have to balance the timings to end up below the two hour mark.
2022-10-29 23:10:49 -07:00
Andrew Kelley
c8f1ea46b5 ci: enable aarch64-linux test coverage
closes #12689
2022-10-29 23:07:16 -07:00