diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2019-01-18 14:24:19 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-18 14:24:19 +0000 |
| commit | fd529b97beae829161348de2e05d72e749154183 (patch) | |
| tree | 7f91e1ef48c44c923e18a347554906bfa05da170 /src | |
| parent | be1a3488a443641d3108326c14df5685279be9de (diff) | |
| parent | 46c610d6e59e0becad790c795f4b1ff159da3a79 (diff) | |
Merge pull request #324 from Tetralux/tet/ptr-endianness
Fix assert when printing IR of pointer with endianness
Diffstat (limited to 'src')
| -rw-r--r-- | src/types.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index eb850fa66..52c06ef71 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1041,6 +1041,8 @@ bool is_type_integer_endian_big(Type *t) { return build_context.endian_kind == TargetEndian_Big; } else if (t->kind == Type_BitSet) { return is_type_integer_endian_big(bit_set_to_int(t)); + } else if (t->kind == Type_Pointer) { + return is_type_integer_endian_big(&basic_types[Basic_uintptr]); } else { GB_PANIC("Unsupported type: %s", type_to_string(t)); } @@ -1058,6 +1060,8 @@ bool is_type_integer_endian_little(Type *t) { return build_context.endian_kind == TargetEndian_Little; } else if (t->kind == Type_BitSet) { return is_type_integer_endian_little(bit_set_to_int(t)); + } else if (t->kind == Type_Pointer) { + return is_type_integer_endian_little(&basic_types[Basic_uintptr]); } else { GB_PANIC("Unsupported type: %s", type_to_string(t)); } |