From d1e72d0854587f3175c1720cda8180fd7878b4d0 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Mon, 14 Jun 2021 23:01:06 +0800 Subject: [PATCH] Check argument count for `CreateThread` --- src/shims/windows/foreign_items.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/shims/windows/foreign_items.rs b/src/shims/windows/foreign_items.rs index eaf1136669f..f12e4df8cdf 100644 --- a/src/shims/windows/foreign_items.rs +++ b/src/shims/windows/foreign_items.rs @@ -342,11 +342,8 @@ fn emulate_foreign_item_by_name( // Better error for attempts to create a thread "CreateThread" => { - this.check_abi_and_shim_symbol_clash( - abi, - Abi::System { unwind: false }, - link_name_sym, - )?; + let &[_, _, _, _, _, _] = + this.check_shim(abi, Abi::System { unwind: false }, link_name_sym, args)?; this.handle_unsupported("can't create threads on Windows")?; return Ok(EmulateByNameResult::AlreadyJumped);