diff options
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 425ec733a8..2a8d6fe418 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9399,7 +9399,12 @@ static TypeTableEntry *ir_analyze_instruction_store_ptr(IrAnalyze *ira, IrInstru if (type_is_invalid(value->value.type)) return value->value.type; - assert(ptr->value.type->id == TypeTableEntryIdPointer); + if (ptr->value.type->id != TypeTableEntryIdPointer) { + ir_add_error(ira, ptr, + buf_sprintf("attempt to dereference non pointer type '%s'", buf_ptr(&ptr->value.type->name))); + return ira->codegen->builtin_types.entry_invalid; + } + if (ptr->value.data.x_ptr.special == ConstPtrSpecialDiscard) { return ir_analyze_void(ira, &store_ptr_instruction->base); } |
