提交 d493659d 编写于 作者: A Alex Crichton

rollup merge of #27666: vadimcn/cabi-typo

I was not able to come up with tests that would expose this bug, as, apparently, Rust types of the args are not used for anything but debug logging.
Thanks to @luqmana for pointing this out!
......@@ -42,10 +42,10 @@ pub fn compute_abi_info(ccx: &CrateContext,
let ty = match t.kind() {
Struct => {
match llsize_of_alloc(ccx, t) {
1 => ArgType::direct(rty, Some(Type::i8(ccx)), None, None),
2 => ArgType::direct(rty, Some(Type::i16(ccx)), None, None),
4 => ArgType::direct(rty, Some(Type::i32(ccx)), None, None),
8 => ArgType::direct(rty, Some(Type::i64(ccx)), None, None),
1 => ArgType::direct(t, Some(Type::i8(ccx)), None, None),
2 => ArgType::direct(t, Some(Type::i16(ccx)), None, None),
4 => ArgType::direct(t, Some(Type::i32(ccx)), None, None),
8 => ArgType::direct(t, Some(Type::i64(ccx)), None, None),
_ => ArgType::indirect(t, Some(Attribute::ByVal))
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册