diff options
| author | Alexandros Naskos <alex_naskos@hotmail.com> | 2020-02-29 08:36:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-29 01:36:42 -0500 |
| commit | 1b41f2d77ea14de27b0655a35a727d664cfc4ca4 (patch) | |
| tree | d3e5996e16424fa205a0f8072670254a04147545 /src/codegen.cpp | |
| parent | a5a53a182af3715edd9474fe94cad2223a6c7fb9 (diff) | |
| download | zig-1b41f2d77ea14de27b0655a35a727d664cfc4ca4.tar.gz zig-1b41f2d77ea14de27b0655a35a727d664cfc4ca4.zip | |
C pointer slices are no longer allowzero (#4462)
* Slices from C pointers are no longer allowzero but instead insert a runtime assertion.
* Added a test, fixed code for cases with non-allowzero C pointers
* Create new type when flipping allow_zero, sometimes we get a cached value back from adjust_ptr_len.
* Added comments, changed panic message
* Added runtime safety test.
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index ee3e05a801..69220382cd 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -973,7 +973,7 @@ static Buf *panic_msg_buf(PanicMsgId msg_id) { case PanicMsgIdExactDivisionRemainder: return buf_create_from_str("exact division produced remainder"); case PanicMsgIdUnwrapOptionalFail: - return buf_create_from_str("attempt to unwrap null"); + return buf_create_from_str("attempt to use null value"); case PanicMsgIdUnreachable: return buf_create_from_str("reached unreachable code"); case PanicMsgIdInvalidErrorCode: |
