diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-14 15:48:28 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-14 15:48:28 -0500 |
| commit | 6769183a9d5f5ec69747f46d4d13c0f8709b2f46 (patch) | |
| tree | 273a352de8765f10482336d510a995543ee3d259 /src/ir.cpp | |
| parent | 52c03de5c2495b369ae730ff203e5342e4f33a36 (diff) | |
| download | zig-6769183a9d5f5ec69747f46d4d13c0f8709b2f46.tar.gz zig-6769183a9d5f5ec69747f46d4d13c0f8709b2f46.zip | |
fix implicit cast error unions with non-optional to optional pointer
and update self hosted compiler for C pointers
See #1059
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 89528db185..7c46b21717 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -8696,7 +8696,7 @@ static ConstCastOnly types_match_const_cast_only(IrAnalyze *ira, ZigType *wanted return result; } bool ok_allows_zero = (wanted_allows_zero && - (actual_allows_zero || wanted_ptr_type->data.pointer.is_const)) || + (actual_allows_zero || !wanted_is_mutable)) || (!wanted_allows_zero && !actual_allows_zero); if (!ok_allows_zero) { result.id = ConstCastResultIdBadAllowsZero; |
