Skip to content

Commit

Permalink
Don't put 0-length array in the lltype of an arg-less variant
Browse files Browse the repository at this point in the history
This seems to confuse LLVM in some very specific situations.

Closes rust-lang#883
  • Loading branch information
marijnh committed Sep 9, 2011
1 parent b6e6f8b commit e57435f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/comp/middle/trans_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e57435f

Please sign in to comment.