fix incorrect type name on bit field pointers

This commit is contained in:
Andrew Kelley 2019-11-05 13:37:43 -05:00
parent 9b4a529164
commit 9a08de93b6
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 2 additions and 3 deletions

View File

@ -552,9 +552,9 @@ ZigType *get_pointer_to_type_extra2(CodeGen *g, ZigType *child_type, bool is_con
const_str, volatile_str, allow_zero_str, buf_ptr(&child_type->name)); const_str, volatile_str, allow_zero_str, buf_ptr(&child_type->name));
} else if (byte_alignment == 0) { } else if (byte_alignment == 0) {
assert(vector_index == VECTOR_INDEX_NONE); assert(vector_index == VECTOR_INDEX_NONE);
buf_appendf(&entry->name, "%salign(:%" PRIu32 ":%" PRIu32 ":%" PRIu32 ") %s%s%s%s", buf_appendf(&entry->name, "%salign(:%" PRIu32 ":%" PRIu32 ") %s%s%s%s",
star_str, star_str,
bit_offset_in_host, host_int_bytes, vector_index, bit_offset_in_host, host_int_bytes,
const_str, volatile_str, allow_zero_str, const_str, volatile_str, allow_zero_str,
buf_ptr(&child_type->name)); buf_ptr(&child_type->name));
} else if (vector_index == VECTOR_INDEX_NONE) { } else if (vector_index == VECTOR_INDEX_NONE) {

View File

@ -25,7 +25,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
); );
cases.add( cases.add(
"dereference vector pointer with unknown runtime index",
"store vector pointer with unknown runtime index", "store vector pointer with unknown runtime index",
\\export fn entry() void { \\export fn entry() void {
\\ var v: @Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; \\ var v: @Vector(4, i32) = [_]i32{ 1, 5, 3, undefined };