fix(macros): stack overflow in invoke handler (#14170)

This commit is contained in:
Tony 2025-09-08 17:38:15 +08:00 committed by GitHub
parent f5851ee00d
commit 69476d8e23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"tauri": "patch:bug"
"tauri-macros": "patch:bug"
---
Fix the stack overflow when having too many commands in a single invoke handler in release build

View File

@ -283,10 +283,9 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream {
macro_rules! #wrapper {
// double braces because the item is expected to be a block expression
($path:path, $invoke:ident) => {
// The IIFE here is for preventing stack overflow on Windows debug build,
// The IIFE here is for preventing stack overflow on Windows,
// see https://github.com/tauri-apps/tauri/issues/12488
{
#[cfg_attr(not(debug_assertions), inline(always))]
move || {
#[allow(unused_imports)]
use #root::ipc::private::*;