diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-26 02:53:42 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-26 02:53:42 -0500 |
| commit | 110a6f39ca9cf578e014461f2e9eef2691a2368d (patch) | |
| tree | 3f79a2b00e02f4b7ba876f1b1e9142217a38200b /src/ir.cpp | |
| parent | 6c9ec3688eead05f1c41e0444a17e1d2bdb7a21e (diff) | |
| download | zig-110a6f39ca9cf578e014461f2e9eef2691a2368d.tar.gz zig-110a6f39ca9cf578e014461f2e9eef2691a2368d.zip | |
IR: pass explicitCastMaybePointers test
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index fe603dc2d9..369369aecf 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -5030,11 +5030,10 @@ static IrInstruction *ir_analyze_maybe_wrap(IrAnalyze *ira, IrInstruction *sourc static IrInstruction *ir_analyze_pointer_reinterpret(IrAnalyze *ira, IrInstruction *source_instr, IrInstruction *ptr, TypeTableEntry *wanted_type) { - assert(wanted_type->id == TypeTableEntryIdPointer); - - if (ptr->value.type->id != TypeTableEntryIdPointer) { - ir_add_error(ira, ptr, - buf_sprintf("expected pointer, found '%s'", buf_ptr(&ptr->value.type->name))); + if (ptr->value.type->id != TypeTableEntryIdPointer && + ptr->value.type->id != TypeTableEntryIdMaybe) + { + ir_add_error(ira, ptr, buf_sprintf("expected pointer, found '%s'", buf_ptr(&ptr->value.type->name))); return ira->codegen->invalid_instruction; } |
