Skip to content

Commit a7e298a

Browse files
committed
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. PR-URL: #19283 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 603afe2 commit a7e298a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/env.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Environment::Environment(IsolateData* isolate_data,
9696
trace_sync_io_(false),
9797
abort_on_uncaught_exception_(false),
9898
emit_napi_warning_(true),
99+
emit_env_nonstring_warning_(true),
99100
makecallback_cntr_(0),
100101
should_abort_on_uncaught_toggle_(isolate_, 1),
101102
#if HAVE_INSPECTOR

0 commit comments

Comments
 (0)