Skip to content

Commit 43ab51b

Browse files
committed
Add the _chkstk for 32 bit windows with msvc.
1 parent 9d4b9b1 commit 43ab51b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/vm/src/probestack.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ cfg_if::cfg_if! {
2525
extern "C" {
2626
pub fn __chkstk();
2727
}
28-
/// The probestack for Windows when compiled with MSVC
28+
/// The probestack for 64bit Windows when compiled with MSVC (note the double underscore)
2929
pub const PROBESTACK: unsafe extern "C" fn() = __chkstk;
30+
} else if #[cfg(all(
31+
target_os = "windows",
32+
target_env = "msvc",
33+
target_pointer_width = "32"
34+
))] {
35+
extern "C" {
36+
pub fn _chkstk();
37+
}
38+
/// The probestack for 32bit Windows when compiled with MSVC (note the singular underscore)
39+
pub const PROBESTACK: unsafe extern "C" fn() = _chkstk;
3040
} else if #[cfg(all(target_os = "windows", target_env = "gnu"))] {
3141
extern "C" {
3242
// ___chkstk (note the triple underscore) is implemented in compiler-builtins/src/x86_64.rs

0 commit comments

Comments
 (0)