aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-08-15 19:36:32 +0100
committergingerBill <bill@gingerbill.org>2018-08-15 19:36:32 +0100
commit042550cf87048d0a05c1de8caec4e59a280b4270 (patch)
tree5b68766873adc80358c5dff00168ca6e61677368
parentb3ebff715a2e483ed1210b7eea70d60a75ae8c3b (diff)
Fix default value bug
-rw-r--r--src/ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 51c285102..e0fe074ff 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -7423,7 +7423,7 @@ void ir_build_proc(irValue *value, irProcedure *parent) {
if (proc->type->Proc.has_proc_default_values) {
auto *p = &proc->type->Proc;
- for_array(i, p->params->Tuple.variables) {
+ if (p->params != nullptr) for_array(i, p->params->Tuple.variables) {
Entity *f = p->params->Tuple.variables[i];
if (f->kind == Entity_Variable) {
ParameterValue pv = f->Variable.param_value;
@@ -7436,7 +7436,7 @@ void ir_build_proc(irValue *value, irProcedure *parent) {
}
}
}
- for_array(i, p->results->Tuple.variables) {
+ if (p->results != nullptr) for_array(i, p->results->Tuple.variables) {
Entity *f = p->results->Tuple.variables[i];
if (f->kind == Entity_Variable) {
ParameterValue pv = f->Variable.param_value;