aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2020-04-01 20:38:32 +0200
committerTimon Kruiper <timonkruiper@gmail.com>2020-04-01 20:38:32 +0200
commitd9cf779b47573f750f9e6ffb6373bfcb75b1632e (patch)
tree4c2d41d9fb91ac9ca73a65aaf97c041f79a1607f /src/ir.cpp
parenta5af78c376fc41424b81ea83766b38a0a1d17870 (diff)
downloadzig-d9cf779b47573f750f9e6ffb6373bfcb75b1632e.tar.gz
zig-d9cf779b47573f750f9e6ffb6373bfcb75b1632e.zip
Fix some nullptr dereferences on arm-linux-musleabhif
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index b9a14d0fe1..215dac5946 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -18982,7 +18982,7 @@ static IrInstGen *ir_analyze_async_call(IrAnalyze *ira, IrInst* source_instr, Zi
if (type_is_invalid(result_loc->value->type) || result_loc->value->type->id == ZigTypeIdUnreachable) {
return result_loc;
}
- result_loc = ir_implicit_cast2(ira, &call_result_loc->source_instruction->base, result_loc,
+ result_loc = ir_implicit_cast2(ira, source_instr, result_loc,
get_pointer_to_type(ira->codegen, frame_type, false));
if (type_is_invalid(result_loc->value->type))
return ira->codegen->invalid_inst_gen;
@@ -19967,14 +19967,16 @@ static IrInstGen *ir_analyze_call_extra(IrAnalyze *ira, IrInst* source_instr,
return ira->codegen->invalid_inst_gen;
IrInstGen *stack = nullptr;
+ IrInst *stack_src = nullptr;
if (stack_is_non_null) {
stack = ir_analyze_optional_value_payload_value(ira, source_instr, opt_stack, false);
if (type_is_invalid(stack->value->type))
return ira->codegen->invalid_inst_gen;
+ stack_src = &stack->base;
}
return ir_analyze_fn_call(ira, source_instr, fn, fn_type, fn_ref, first_arg_ptr, first_arg_ptr_src,
- modifier, stack, &stack->base, false, args_ptr, args_len, nullptr, result_loc);
+ modifier, stack, stack_src, false, args_ptr, args_len, nullptr, result_loc);
}
static IrInstGen *ir_analyze_instruction_call_extra(IrAnalyze *ira, IrInstSrcCallExtra *instruction) {