Commit Graph

21874 Commits

Author SHA1 Message Date
Jeremy Volkman b0bfde917b Add support for -undefined error
`-undefined dynamic_lookup` was added in #13991. `-undefined error` is the
opposite, and can be used to revert an `-undefined dynamic_lookup` flag
specified previously on the command line.
2022-12-27 08:18:04 -08:00
Jakub Konka a70cbe779a macho: add Zig wrapper for compact unwind encoding on arm64 2022-12-27 15:36:28 +01:00
Veikka Tuominen af9a9a1374 zig fmt: improve handling of comptime tuple fields 2022-12-27 13:52:37 +02:00
zooster 547e3684be langref: more explicitly document how enum overriding works 2022-12-27 12:53:41 +02:00
Andrew Kelley 3a7a39cb91 Merge pull request #14078 from jacobly0/llvm-opaque-ptrs
llvm: remove unnecessary code for opaque pointers
2022-12-27 04:57:01 -05:00
Jacob Young 81318e8704 llvm: add asserts and behavior tests for #14063
Closes #14063
2022-12-27 00:12:56 -05:00
Jacob Young 46b49a0a76 llvm: cleanup code no longer needed with opaque pointers
When using llvm opaque pointers, typed pointers and pointer bitcasts are
no longer needed.  This also avoids needing packed struct layouts that
are nested inside pointers, letting us avoid computing struct layouts
in Sema that could cause unnecessary dependency loops.
2022-12-27 00:12:56 -05:00
Andrew Kelley 1b86a628ac Merge pull request #14015 from Vexu/recursive-inline
Sema: add error for recursive inline call
2022-12-26 20:34:22 -05:00
Andrew Kelley b0cd24f90e Merge pull request #14070 from jacobly0/issue/14032
Fix #14032
2022-12-26 18:06:19 -05:00
zooster 728cc73819 std.Target.ObjectFormat: specify dxcontainer file ext 2022-12-26 18:03:27 -05:00
Veikka Tuominen 81443fcde8 Sema: add error for recursive inline call
Closes #12973
2022-12-26 16:36:30 +02:00
Veikka Tuominen 0b859831ad update grammar in langref
Closes #14072
2022-12-26 16:36:29 +02:00
Veikka Tuominen 3535c4b3b6 Sema: fix elem ptr type of vector in slice
Closes #14071
2022-12-26 15:26:27 +02:00
Jacob Young 64865679cf Sema: add missing resolveLazyValue cases
Closes #14032
2022-12-26 04:39:32 -05:00
Jacob Young 8dd844d96f Sema: fix typo 2022-12-26 04:18:08 -05:00
Matt Knight cf822c6ddd @export() with linksection option (#14035) 2022-12-25 20:19:50 -05:00
Jacob Young f5b6019646 Sema: fix missing struct layout for llvm backend
Closes #14063
2022-12-25 20:18:15 -05:00
zooster 0c30e006c9 delete empty.zig
This is no longer used anywhere.
2022-12-24 23:17:27 -05:00
Andrew Kelley a193ec432d Merge pull request #14058 from jacobly0/concat 2022-12-24 13:55:42 -05:00
Jacob Young 6f288051c1 behavior: disable tests on failing backends 2022-12-24 02:54:21 -05:00
Jacob Young bc913295b5 CBE: fix emitting a partially undefined string literal 2022-12-24 02:40:33 -05:00
Jacob Young 6cd8004213 Sema: relax undefined checks for concat
Closes #14037
2022-12-24 02:40:33 -05:00
Jacob Young 0559cdb554 Sema: support concat of tuple and array
Closes #14041
2022-12-24 02:40:33 -05:00
Kim SHrier 5bde627f9d map lower case amd64 to x86_64 2022-12-24 02:23:31 -05:00
Jacob Young fc0789f8e7 behavior: disable tests that trigger an llvm 15 bug and assertion
```
LLVM Emit Object... zig: llvm/include/llvm/ADT/APInt.h:840: void llvm::APInt::lshrInPlace(unsigned int): Assertion `ShiftAmt <= BitWidth && "Invalid shift amount"' failed.
Aborted
```

Tracked by #13782
2022-12-24 02:23:05 -05:00
Frank Denis c9e3524d0b HKDF allow expansion up to, and including <hash size> * 255 bytes (#14051)
Fixes #14050
2022-12-23 21:38:27 +00:00
travisstaloch 581d292381 fix overflow found while fuzzing
* allow file level `union {}` to parse as tuple field

this was found while fuzzing zls.

* before this patch the input `union {}` crashed the parser.  after
  this, it parses correctly just like `struct {}`.
* adds behavior tests for both inputs `struct {}` and `union {}`,
  checking that each becomes a file level tuple field.
2022-12-23 23:10:04 +02:00
Jakub Konka bb62d5105c Merge pull request #14049 from ziglang/issue-14045
macho+zld: write code signature padding before committing load commands
2022-12-23 19:07:36 +01:00
Jakub Konka 22b39f034b macho+zld: properly deinit code signature object 2022-12-23 14:35:45 +01:00
Jakub Konka 2cb6db2219 link-tests: add macho strict validation test
Support more operators when running simple arithmetic tests, and
allow for int literals in the program spec.
2022-12-23 14:02:52 +01:00
Jakub Konka 550ebcce9a macho+zld: write code signature padding before commiting LCs
Otherwise, we were prematurely committing `__LINKEDIT` segment LC
with outdated size (i.e., without code signature being taken into account).
This would scaffold into strict validation failures by Apple tooling.
2022-12-23 12:50:03 +01:00
Andrew Kelley f211c1559a Merge pull request #13960 from r00ster91/stage1cruft
Close more old stage1 issues
2022-12-22 16:36:55 -05:00
Frank Denis 8d66aacb64 compiler-rt: implement __udivei4 and __umodei4 (#14023)
Allows dividing and formatting arbitrary-large unsigned integers.
2022-12-22 16:29:19 -05:00
Ryan Liptak 71668fc4e3 Dir.openDirAccessMaskW: Add ACCESS_DENIED as a possible error
Can occur when trying to open a directory for iteration but the 'List folder contents' permission of the directory is set to 'Deny'.

This was found because it was being triggered during PATH searching in ChildProcess.spawnWindows if a PATH entry did not have 'List folder contents' permission, so this fixes that as well (note: the behavior on hitting this during PATH searching is to treat it as the directory not existing and therefore will fail to find any executables in a directory in the PATH without 'List folder contents' permission; this matches Windows behavior which also fails to find commands in directories that do not have 'List folder contents' permission).
2022-12-22 14:03:05 -05:00
Andrew Kelley 266e2e9a31 Revert "CI: workaround git bug regarding changed attributes"
This reverts commit aa44512b85.

This commit is no longer needed.
2022-12-21 17:17:28 -07:00
r00ster91 a429f72ae8 cases: more test coverage
Closes #11986
Closes #11850
Closes #12159
2022-12-21 23:34:29 +01:00
r00ster91 5ecc2b99af behavior: more test coverage
Closes #12450
Closes #13113
Closes #12051
Closes #12092
Closes #12119
Closes #12142
Closes #12450
Closes #13113
Closes #11995
Closes #12000
2022-12-21 23:34:22 +01:00
Ganesan Rajagopal 06f70c030a Fix missing pthread_key_t definition on linux
* pthread_key_t should also be available for non-android platforms
* Also change the type to c_uint because Linux pthreadtypes.h typedefs it as "unsigned int"

Partially addresses #13950
2022-12-21 17:00:41 -05:00
Luuk de Gram 0d66112643 wasm: refactor extended instructions
The extended instructions starting with opcode `0xFC` are refactored
to make the work the same as the SIMD instructions. This means a
`Mir` instruction no longer contains a field 'secondary'. Instead,
we use the `payload` field to store the index into the extra list
which contains the extended opcode value. In case of instructions
such as 'memory.fill' which also have an immediate value, such
values will also be stored in the extra list right after the
instruction itself. This makes each `Mir` instruction smaller.
2022-12-21 17:02:53 +01:00
Jacob Young a52dcdd3c5 CBE: fix bitwise not
Closes #13911
2022-12-21 03:04:59 -05:00
zenith391 471f3c470f compiler_rt: Remove errdefer in ObjectArray.init
These errdefer where never executed, while this didn't bother the stage1
compiler, it caused an error in stage2.

The fix is just removing those errdefer which doesn't change any
behaviour because they were never executed in the first place.
2022-12-20 16:42:12 -05:00
Andrew Kelley 775b0c1347 Revert "c.zig: Add definition for pthread_key_t"
This reverts commit aa3964477f.

This declaration is already provided by operating-system-specific files.
This is not the correct solution to the problem.

See #14013
Reopens #13950
2022-12-20 14:37:05 -07:00
Veikka Tuominen e1345fd0a0 Merge pull request #14004 from Vexu/packed-struct-vector
llvm: handle vectors in packed structs
2022-12-20 23:13:36 +02:00
Jakub Konka dc22c3b9a5 Merge pull request #14006 from Luukdegram/wasm-no-lld
wasm-linker: allow usage of the in-house WebAssembly linker
2022-12-20 18:42:14 +01:00
Veikka Tuominen 9f23702c21 llvm: fix C ABI for <=256 bit vectors
Closes #13918
2022-12-20 18:34:33 +02:00
travisstaloch 4aa8462cc9 std.zig: fix integer overflows during parsing
these were found while fuzzing zls.

this patch prevents overflow for the following file contents and adds
tests for them.
	* `enum(u32)` - causes overflow in std.zig.Ast.fullContainerDecl()
	* `*x` - causes overflow in std.zig.Ast.fullPtrType()
	* `**x` - causes overflow in std.zig.Ast.firstToken()
2022-12-20 17:33:40 +02:00
Veikka Tuominen 6da070c5ac Sema: fix crash with generic function with generic function parameter
Closes #12810
2022-12-20 17:32:04 +02:00
Jakub Konka 3a1295cd6f macho: add missing defs of compact unwind info records 2022-12-20 16:20:48 +01:00
Andrew Kelley 0fb53bd245 Merge pull request #14000 from jacobly0/zero-bit-fields
codegen: fix taking the address of a field in a zero-bit struct
2022-12-19 15:47:31 -05:00
Manlio Perillo 3542dbf0ea langref: add section numbers
When reading a document with nested sections, it is not easy to discover
the depth of the current section.

Add support for nested section numbers, from the h2 to the h4 heading,
in the format "lv1. ", "lv1.lv2. ", "lv1.lv2.lv3. ".  The "Zig Version"
and "Table of Content" sections are excluded.

The section numbers are implemented in CSS, with the CSS rules declared
inside a @media rule.  Currently the @media rule targets all media.
2022-12-19 21:51:23 +02:00