parent
0aae96b5f0
commit
0b8f19fcba
@ -609,7 +609,10 @@ TypeTableEntry *get_array_type(CodeGen *g, TypeTableEntry *child_type, uint64_t
|
|||||||
buf_resize(&entry->name, 0);
|
buf_resize(&entry->name, 0);
|
||||||
buf_appendf(&entry->name, "[%" ZIG_PRI_u64 "]%s", array_size, buf_ptr(&child_type->name));
|
buf_appendf(&entry->name, "[%" ZIG_PRI_u64 "]%s", array_size, buf_ptr(&child_type->name));
|
||||||
|
|
||||||
if (!entry->zero_bits) {
|
if (entry->zero_bits) {
|
||||||
|
entry->di_type = ZigLLVMCreateDebugArrayType(g->dbuilder, 0,
|
||||||
|
0, child_type->di_type, 0);
|
||||||
|
} else {
|
||||||
entry->type_ref = child_type->type_ref ? LLVMArrayType(child_type->type_ref,
|
entry->type_ref = child_type->type_ref ? LLVMArrayType(child_type->type_ref,
|
||||||
(unsigned int)array_size) : nullptr;
|
(unsigned int)array_size) : nullptr;
|
||||||
|
|
||||||
|
@ -79,3 +79,11 @@ fn assertSlicePtrsEql(args: ...) {
|
|||||||
assert(s1.ptr == s2.ptr);
|
assert(s1.ptr == s2.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
test "pass zero length array to var args param" {
|
||||||
|
doNothingWithFirstArg("");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn doNothingWithFirstArg(args: ...) {
|
||||||
|
const a = args[0];
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user