From d5b34c4b1044aa105bf71a6f9a2a6c03b4b84ea8 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sun, 11 Mar 2018 11:22:18 +0100 Subject: [PATCH] src: init emit_env_nonstring_warning_ Currently there is no member initialiser for emit_env_nonstring_warning_ in the Environment constructor leading to undefined behaviour. For a debug build, this memory would be initialized: (lldb) memory read -f x -s 4 -c 1 &emit_env_nonstring_warning_ 0x7fff5fbfe254: 0x00000001 But for a release build there will be no such initialization: (lldb) memory read -f x -s 4 -c 1 `$r12 + 0x46c` 0x7fff5fbfe374: 0x00000000 This can be seen by running test-process-env-deprecation.js using the Debug build and the Release build. This commit adds a member initialiser for emit_env_nonstring_warning_ setting it to true. --- src/env.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/env.cc b/src/env.cc index 6e090679c24baf..7b42ebbea049b9 100644 --- a/src/env.cc +++ b/src/env.cc @@ -96,6 +96,7 @@ Environment::Environment(IsolateData* isolate_data, trace_sync_io_(false), abort_on_uncaught_exception_(false), emit_napi_warning_(true), + emit_env_nonstring_warning_(true), makecallback_cntr_(0), should_abort_on_uncaught_toggle_(isolate_, 1), #if HAVE_INSPECTOR