7065 Commits

Author SHA1 Message Date
Andrew Kelley
8d73703d52
fix safety for sentinel-slicing floats 2019-12-20 18:28:59 -05:00
Andrew Kelley
8918cb06fc
sentinel slicing improvements
* add runtime safety for slicing pointers, arrays, and slices.
 * slicing without a sentinel value results in non-sentineled slice
 * improved `std.debug.panic` handling of panic-during-panic
2019-12-20 18:28:59 -05:00
Andrew Kelley
26f3c2d061
fix std.mem.addNullByte and implement sentinel slicing
see #3770
2019-12-20 18:28:56 -05:00
LemonBoy
51cbd96820 Fix sentinel value of opaque pointers in typeInfo
Fixes #3888
2019-12-20 15:48:34 -05:00
LemonBoy
f077c3c4cc Fix comptime evaluation of runtime array access
Fix #3951
2019-12-20 15:47:43 -05:00
Andrew Kelley
9daa7e1e19
CI: update llvm apt sources to correct ubuntu version
In the pipelines.yml file we request Ubuntu 18.04 Bionic Beaver, but in
the script we were still using the Xenial apt.llvm.org sources.
2019-12-20 13:40:07 -05:00
Andrew Kelley
4d54e9a4fb
Merge pull request #3918 from kprotty/lock_fix
Synchronization primitive improvements
2019-12-17 20:04:02 -05:00
kprotty
c912296443 SpinLock: loopHint & yield distinction 2019-12-17 15:38:00 -06:00
kprotty
26e08d5701 ResetEvent: use futex on linux when possible 2019-12-17 15:38:00 -06:00
kprotty
ac5ba27c2b Mutex: fix lock/spin bugs, improve perf slightly & more specialization 2019-12-17 15:38:00 -06:00
kprotty
e67ce444e7 ResetEvent: simpler interface + fix tests 2019-12-17 15:38:00 -06:00
kprotty
947db78622 Spinlock: remove Backoff & improve yielding 2019-12-17 15:38:00 -06:00
LemonBoy
d8499f7abe Make sure the fields array is always non-null
Fixes #3497
2019-12-17 15:45:22 -05:00
Nathan Michaels
f389e5e61f Clarify allowzero's interaction with optional pointers. 2019-12-17 15:44:34 -05:00
Raul Leal
62c817420d [#3844 + #3767] update std.c and std.os.linux to use null-terminated pointer types (#3900)
* #3844 update std.c functions to use null-terminated pointer types

* check linux functions

* fix callsites

* fix io test

* Add allocPrintCstr function to remove other cast
2019-12-17 15:43:49 -05:00
Andrew Kelley
b242c2ac10
avoid using undefined value
closes #3933
2019-12-16 22:47:19 -05:00
Andrew Kelley
b1abe4a172
Revert "added -- to pass args to zig build commands"
This reverts commit d4e56ae6ae15ed1b062b0d775893abb5579fc66d.

This broke the build
2019-12-16 16:36:42 -05:00
Dmitry Atamanov
744133acb1 Fixes utf8ToUtf16Le (#3923) 2019-12-16 16:27:26 -05:00
emekoi
d4e56ae6ae added -- to pass args to zig build commands 2019-12-16 16:24:54 -05:00
Andrew Kelley
13cdc137e6
Merge pull request #3570 from ziglang/c-sanitize-undef
use -fsanitize=undefined for C code in safe build modes
2019-12-16 16:17:52 -05:00
LemonBoy
de0d8885b4 Fix alignment query on unresolved types
Fixes #3919
2019-12-16 15:54:06 -05:00
Andrew Kelley
839b3a61ad
expose the ability to disable C sanitization
and disable C sanitization when building libcs.
Empirically, they seem to trigger undef-sanitization.
2019-12-16 13:51:21 -05:00
Andrew Kelley
f8cd981c04
use -fsanitize=undefined for C code in safe build modes
closes #3569
2019-12-16 13:06:02 -05:00
Henry Wu
170de5ecae generated docs: log trace instead of error
When the error occurred for getValueText it could potentially omit
useful documentation since the page stops rendering.
2019-12-16 12:40:38 -05:00
xackus
cb5a5ebb20 langref table of contents in a separate column on large displays 2019-12-16 12:25:56 -05:00
Andrew Kelley
b3cbf290c8
remove misleading documentation 2019-12-16 12:07:05 -05:00
Andrew Kelley
496f271d17
Merge branch 'shawnl-lessThan'
* always allow integer comparison operations no matter the
   bit width, signedness, or comptime-ness of operands.
   closes #2133
 * implement comparisons for vectors, which returns vector of
   bools.

closes #3001
2019-12-16 11:39:13 -05:00
Andrew Kelley
1cad0acc7e
add behavior test for vector comparison 2019-12-16 11:22:28 -05:00
Andrew Kelley
9468d63819
allow comparison of any numeric types 2019-12-16 11:09:10 -05:00
Lachlan Easton
fe0e8c87b7 Tokenizer: Copy optional tokens prior to being set to null #3737 (#3910)
* Tokenizer: Copy optional tokens prior to being set to null #3737

* Add TODO comments, reminder to audit copying optional pattern.
2019-12-16 11:01:02 -05:00
Andrew Kelley
0f09ff4923
Merge pull request #3916 from Vexu/translate-c-2
Translate-c-2 macros
2019-12-16 10:55:32 -05:00
Andrew Kelley
650acc5e3d
Merge pull request #3922 from LemonBoy/eventfd-err
More eventfd stuff
2019-12-16 10:45:09 -05:00
Vexu
04dc0bd0e4
translate-c-2 variable aliasing 2019-12-16 12:45:00 +02:00
LemonBoy
9d9b0720f5 Fix for the error codepath in ChildProcess 2019-12-16 10:57:29 +01:00
LemonBoy
c257f892fd Revert "Revert "Use eventfd in ChildProcess on Linux""
This reverts commit 2c7a2aefbfd0dbab190f912b4fbcbda96fb5ac44.
2019-12-16 10:56:53 +01:00
Vexu
a37caaa528
translate-c-2 parameter name aliasing 2019-12-16 10:39:31 +02:00
Shawn Landden
143603b39f
std: lessThan and greaterThan between signed and unsigned
It is a deviation from C, but I think we should consider making this the behavior
of the operators. See #2133
2019-12-16 01:41:26 -05:00
Andrew Kelley
2c7a2aefbf
Revert "Use eventfd in ChildProcess on Linux"
This reverts commit b169f7b0d51fa9e7cf570479079369b9736093ff.

This caused `integer cast truncated bits` at
std/child_process.zig:801:12

Can be reproduced on my machine simply by running `make`.
2019-12-16 01:39:41 -05:00
Vexu
620bf695e8
organize tests 2019-12-16 07:43:18 +02:00
Vexu
0f38410ea6
improve extern enum 2019-12-15 19:28:53 -05:00
Vexu
ab60c8e28f
c tokenizer escape sequences 2019-12-16 00:55:50 +02:00
Vexu
9f0e83a571
translate-c-2 macro functions 2019-12-15 23:46:35 +02:00
LemonBoy
59de23dfa0 Don't assume TLS storage has a fixed address
Fixes #3433
2019-12-15 16:23:42 -05:00
LemonBoy
b169f7b0d5 Use eventfd in ChildProcess on Linux
Closes #819
2019-12-15 14:43:37 -05:00
LemonBoy
f1407b4b7e Generate the fn pointers into the correct address space
Fixes #3645
2019-12-15 14:42:53 -05:00
LemonBoy
19ddbd9e9e Make sure the address is aligned for intToPtr ops
Closes #773
2019-12-15 14:41:05 -05:00
Vexu
ed2a19dcec
translate-c-2 macro cast 2019-12-15 21:32:30 +02:00
Vexu
57170f9eb6
translate-c-2 macro inline fn 2019-12-15 19:28:34 +02:00
Vexu
75218d4765
translate-c-2 macros 2019-12-15 14:44:11 +02:00
Vexu
c3724a6e72
translate-c-2 c tokenizer 2019-12-15 10:30:38 +02:00