Skip to content

Commit bf1f0a6

Browse files
committed
add. #[inline(never)] tag to gurantee , new stack frame is issued.
1 parent 8faa8f0 commit bf1f0a6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lang/syn/src/codegen/accounts/constraints.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ fn generate_constraint_init_group(
545545
// Define the bump and pda variable.
546546
#find_pda
547547

548-
let #field: #ty_decl = (||{
548+
let #field: #ty_decl = ({#[inline(never)] ||{
549549
// Checks that all the required accounts for this operation are present.
550550
#optional_checks
551551

@@ -580,7 +580,7 @@ fn generate_constraint_init_group(
580580
}
581581
}
582582
Ok(pa)
583-
})()?;
583+
}})()?;
584584
}
585585
}
586586
InitKind::AssociatedToken {
@@ -616,7 +616,7 @@ fn generate_constraint_init_group(
616616
// Define the bump and pda variable.
617617
#find_pda
618618

619-
let #field: #ty_decl = (||{
619+
let #field: #ty_decl = ({#[inline(never)] ||{
620620
// Checks that all the required accounts for this operation are present.
621621
#optional_checks
622622

@@ -653,7 +653,7 @@ fn generate_constraint_init_group(
653653
}
654654
}
655655
Ok(pa)
656-
})()?;
656+
}})()?;
657657
}
658658
}
659659
InitKind::Mint {
@@ -1012,7 +1012,7 @@ fn generate_constraint_init_group(
10121012
// Define the bump variable.
10131013
#find_pda
10141014

1015-
let #field = (||{
1015+
let #field = ({#[inline(never)] ||{
10161016
// Checks that all the required accounts for this operation are present.
10171017
#optional_checks
10181018

@@ -1058,7 +1058,7 @@ fn generate_constraint_init_group(
10581058

10591059
// Done.
10601060
Ok(pa)
1061-
})()?;
1061+
}})()?;
10621062
}
10631063
}
10641064
}

tests/zero-copy/programs/zero-copy/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ idl-build = ["anchor-lang/idl-build"]
1919

2020
[dependencies]
2121
anchor-lang = { path = "../../../../lang" }
22+
# anchor-lang = "0.30.0"
2223
bytemuck = {version = "1.4.0", features = ["derive", "min_const_generics"]}
2324

2425
[dev-dependencies]

0 commit comments

Comments
 (0)