diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-01-31 02:30:10 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-01-31 02:30:10 -0500 |
| commit | d8da34c64c0def6915cead3e16991ed97515ed71 (patch) | |
| tree | 010c2f67000a84b9061b5218ef4a95444d320c2e /src/ir.cpp | |
| parent | d2b94afaf2383bbcb03ab201e544aa830c082e99 (diff) | |
| download | zig-d8da34c64c0def6915cead3e16991ed97515ed71.tar.gz zig-d8da34c64c0def6915cead3e16991ed97515ed71.zip | |
fix crash when assigning too large value to integer
closes #228
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index f5604194de..eee938c018 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7591,6 +7591,11 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc var->value.type = result_type; assert(var->value.type); + if (result_type->id == TypeTableEntryIdInvalid) { + decl_var_instruction->base.other = &decl_var_instruction->base; + return ira->codegen->builtin_types.entry_void; + } + bool is_comptime = ir_get_var_is_comptime(var); if (casted_init_value->value.special != ConstValSpecialRuntime) { |
