diff options
| author | gingerBill <bill@gingerbill.org> | 2020-08-05 23:33:35 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-08-05 23:33:35 +0100 |
| commit | f5248a8d9d397622e5ae7fa240f1e3ef75d06d22 (patch) | |
| tree | ae75226ad480d8c48b081a725d169449f34f0ad7 /src | |
| parent | 74ed779616aead2d9dc6f5123c59ad561b9d594e (diff) | |
Fix #705
Diffstat (limited to 'src')
| -rw-r--r-- | src/checker.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index ed26c6d70..b8962ed63 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1377,8 +1377,11 @@ void add_type_info_type(CheckerContext *c, Type *t) { break; case Type_Union: - add_type_info_type(c, t_int); - add_type_info_type(c, t_type_info_ptr); + if (union_tag_size(t) > 0) { + add_type_info_type(c, union_tag_type(t)); + } else { + add_type_info_type(c, t_type_info_ptr); + } for_array(i, bt->Union.variants) { add_type_info_type(c, bt->Union.variants[i]); } @@ -1589,8 +1592,11 @@ void add_min_dep_type_info(Checker *c, Type *t) { break; case Type_Union: - add_min_dep_type_info(c, t_int); - add_min_dep_type_info(c, t_type_info_ptr); + if (union_tag_size(t) > 0) { + add_min_dep_type_info(c, union_tag_type(t)); + } else { + add_min_dep_type_info(c, t_type_info_ptr); + } for_array(i, bt->Union.variants) { add_min_dep_type_info(c, bt->Union.variants[i]); } |