Commit a7e298a4 authored by Daniel Bevenius's avatar Daniel Bevenius
Browse files

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: https://github.com/nodejs/node/pull/19283


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent 603afe25
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment