mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 14:59:14 +00:00
CBE: fix emitting a partially undefined string literal
This commit is contained in:
parent
6cd8004213
commit
bc913295b5
@ -1066,7 +1066,10 @@ pub const DeclGen = struct {
|
||||
var index: usize = 0;
|
||||
while (index < ai.len) : (index += 1) {
|
||||
const elem_val = try val.elemValue(dg.module, arena_allocator, index);
|
||||
const elem_val_u8 = @intCast(u8, elem_val.toUnsignedInt(target));
|
||||
const elem_val_u8 = if (elem_val.isUndef())
|
||||
undefPattern(u8)
|
||||
else
|
||||
@intCast(u8, elem_val.toUnsignedInt(target));
|
||||
try writeStringLiteralChar(writer, elem_val_u8);
|
||||
}
|
||||
if (ai.sentinel) |s| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user