Skip to content

Commit 683a622

Browse files
committed
modified: compiler/rustc_codegen_llvm/src/attributes.rs
1 parent 32b5418 commit 683a622

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,17 @@ fn stackprotector_attr<'ll, 'tcx>(
275275
cx: &CodegenCx<'ll, 'tcx>,
276276
instance: ty::Instance<'tcx>,
277277
) -> Option<&'ll Attribute> {
278-
let fn_abi = cx.fn_abi_of_instance(instance, ty::List::empty());
279278
let sspattr = match cx.sess().stack_protector() {
280279
StackProtector::None => return None,
281280
StackProtector::All => AttributeKind::StackProtectReq,
282281

283282
StackProtector::Rusty => {
283+
let fn_abi = cx.fn_abi_of_instance(instance, ty::List::empty());
284284
if cx.tcx.stack_protector.borrow().contains(&instance.def_id())
285285
|| matches!(
286286
&fn_abi.ret.mode,
287+
// When a large-size variable is converted to a pointer and passed,
288+
// does meta_attrs always have to be Some(_)?
287289
PassMode::Indirect { attrs: _, meta_attrs: _, on_stack: false }
288290
)
289291
{

0 commit comments

Comments
 (0)