Don't put 0-length array in the lltype of an arg-less variant

This seems to confuse LLVM in some very specific situations.

Closes #883
This commit is contained in:
Marijn Haverbeke 2011-09-09 13:43:32 +02:00
parent b6e6f8b810
commit e57435f68b

View file

@ -696,7 +696,11 @@ fn T_opaque_closure_ptr(cx: &crate_ctxt) -> TypeRef {
fn T_tag(tn: &type_names, size: uint) -> TypeRef {
let s = "tag_" + uint::to_str(size, 10u);
if tn.name_has_type(s) { ret tn.get_type(s); }
let t = T_struct([T_int(), T_array(T_i8(), size)]);
let t = if size == 0u {
T_struct([T_int()])
} else {
T_struct([T_int(), T_array(T_i8(), size)])
};
tn.associate(s, t);
ret t;
}