Skip to content

Commit ace6e07

Browse files
nornagontargos
authored andcommitted
src: initialize pid variable before goto
This fixes an error when compiling with clang-cl on Windows: ``` src/node.cc(2437,5): error: jump from this goto statement to its label is a Microsoft extension [-Werror,-Wmicrosoft-goto] goto out; ^ src/node.cc(2441,9): note: jump bypasses variable initialization DWORD pid = args[0].As<Integer>()->Value(); ^ ``` PR-URL: #22961 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 0140a98 commit ace6e07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2278,14 +2278,15 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
22782278
HANDLE mapping = nullptr;
22792279
wchar_t mapping_name[32];
22802280
LPTHREAD_START_ROUTINE* handler = nullptr;
2281+
DWORD pid = 0;
22812282

22822283
if (args.Length() != 1) {
22832284
env->ThrowError("Invalid number of arguments.");
22842285
goto out;
22852286
}
22862287

22872288
CHECK(args[0]->IsNumber());
2288-
DWORD pid = args[0].As<Integer>()->Value();
2289+
pid = args[0].As<Integer>()->Value();
22892290

22902291
process = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION |
22912292
PROCESS_VM_OPERATION | PROCESS_VM_WRITE |

0 commit comments

Comments
 (0)