summaryrefslogtreecommitdiffhomepage
path: root/ir/be/mips
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2017-01-14 10:49:41 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2017-01-14 10:49:41 +0100
commitf1f23d72c545b89fa4ebe9b3032499ac7af741b9 (patch)
tree25da2be7eecc710cd65bb8bc5119a733b5e65599 /ir/be/mips
parent75257d05aa8554441a637fb7ed2092fc7f7cfddb (diff)
mips: Show a nicer panic instead of a segfault for the unhandled struct parameters and returns.
Diffstat (limited to 'ir/be/mips')
-rw-r--r--ir/be/mips/mips_cconv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ir/be/mips/mips_cconv.c b/ir/be/mips/mips_cconv.c
index fdeb314..e45f770 100644
--- a/ir/be/mips/mips_cconv.c
+++ b/ir/be/mips/mips_cconv.c
@@ -34,7 +34,9 @@ void mips_determine_calling_convention(mips_calling_convention_t *const cconv, i
for (size_t i = 0; i != n_params; ++i) {
ir_type *const param_type = get_method_param_type(fun_type, i);
ir_mode *const param_mode = get_type_mode(param_type);
- if (mode_is_float(param_mode)) {
+ if (!param_mode) {
+ panic("TODO");
+ } else if (mode_is_float(param_mode)) {
panic("TODO");
} else {
if (param_type->flags & tf_lowered_dw && gp_param % 2 != 0)
@@ -62,7 +64,9 @@ void mips_determine_calling_convention(mips_calling_convention_t *const cconv, i
for (size_t i = 0; i != n_results; ++i) {
ir_type *const res_type = get_method_res_type(fun_type, i);
ir_mode *const res_mode = get_type_mode(res_type);
- if (mode_is_float(res_mode)) {
+ if (!res_mode) {
+ panic("TODO");
+ } else if (mode_is_float(res_mode)) {
panic("TODO");
} else {
if (gp_res == ARRAY_SIZE(regs_result_gp))