Commit 2b4bf1e7ce

LemonBoy <thatlemon@gmail.com>
2019-11-04 10:38:48
Fix crash in #3483
The bytesToSlice is still not evaluated at comptime but at least it doesn't crash anymore.
1 parent 6182506
Changed files (1)
src
src/ir.cpp
@@ -1668,7 +1668,7 @@ static IrInstruction *ir_build_resize_slice(IrAnalyze *ira, IrInstruction *sourc
     instruction->result_loc = result_loc;
 
     ir_ref_instruction(operand, ira->new_irb.current_basic_block);
-    ir_ref_instruction(result_loc, ira->new_irb.current_basic_block);
+    if (result_loc != nullptr) ir_ref_instruction(result_loc, ira->new_irb.current_basic_block);
 
     return &instruction->base;
 }