Add a CLI option for the maximum stack size (#5156)

This should allow either increasing or decreasing it for debugging and
otherwise prodding at stack overflow behavior from the CLI.
This commit is contained in:
Alex Crichton
2022-10-31 09:52:13 -05:00
committed by GitHub
parent b7b914fa0f
commit 95ecb7e4d4

View File

@@ -229,6 +229,11 @@ pub struct CommonOptions {
#[cfg(feature = "pooling-allocator")]
#[clap(long)]
pub pooling_allocator: bool,
/// Maximum stack size, in bytes, that wasm is allowed to consumed before a
/// stack overflow is reported.
#[clap(long)]
pub max_wasm_stack: Option<usize>,
}
impl CommonOptions {
@@ -335,6 +340,10 @@ impl CommonOptions {
}
}
if let Some(max) = self.max_wasm_stack {
config.max_wasm_stack(max);
}
Ok(config)
}