From fd1a701a4985b9716418856501db93431a95efdd Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Wed, 19 Sep 2018 14:56:24 -0700 Subject: [PATCH] fix: microsoft-goto warning w/ clang-cl see nodejs/node#22961 --- src/node.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index ef770867ce..b748795a66 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2432,13 +2432,15 @@ static void DebugProcess(const FunctionCallbackInfo& args) { wchar_t mapping_name[32]; LPTHREAD_START_ROUTINE* handler = nullptr; + DWORD pid; + if (args.Length() != 1) { env->ThrowError("Invalid number of arguments."); goto out; } CHECK(args[0]->IsNumber()); - DWORD pid = args[0].As()->Value(); + pid = args[0].As()->Value(); process = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE |