aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-11-22 09:41:08 +0000
committergingerBill <bill@gingerbill.org>2018-11-22 09:41:08 +0000
commit6ab644779104cef2d6db5b3fb9f67d256ff1f195 (patch)
tree5e9bc09c06a5c5d529b4dab39e661c2c308e3243 /src/ir.cpp
parentf61c4715c12647c9b6ec2ec745aeb835d3ad8df8 (diff)
Fix is_type_polymorphic infinite recursion bug
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 3e9819caa..a2fb97202 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -5163,7 +5163,7 @@ String ir_mangle_name(irGen *s, Entity *e) {
isize max_len = pkgn.len + 1 + name.len + 1;
- bool require_suffix_id = is_type_polymorphic(e->type);
+ bool require_suffix_id = is_type_polymorphic(e->type, true);
if (require_suffix_id) {
max_len += 21;
}
@@ -5192,7 +5192,7 @@ void ir_mangle_add_sub_type_name(irModule *m, Entity *field, String parent) {
String cn = field->token.string;
isize max_len = parent.len + 1 + 16 + 1 + cn.len;
- bool require_suffix_id = is_type_polymorphic(field->type);
+ bool require_suffix_id = is_type_polymorphic(field->type, true);
if (require_suffix_id) {
max_len += 21;
}
@@ -5325,6 +5325,8 @@ void ir_gen_global_type_name(irModule *m, Entity *e, String name) {
ir_mangle_add_sub_type_name(m, sub, name);
}
}
+ } else {
+ GB_PANIC("Unknown poly type %s %p", type_to_string(e->type), e);
}
return;
}