-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: fix use of uninitialized variable #9281
Conversation
ping @addaleax @bnoordhuis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit. Does valgrind -q
complain without this patch? If no, consider adding a regression test.
@@ -521,7 +521,9 @@ static void GetStringWidth(const FunctionCallbackInfo<Value>& args) { | |||
TwoByteValue value(env->isolate(), args[0]); | |||
// reinterpret_cast is required by windows to compile | |||
UChar* str = reinterpret_cast<UChar*>(*value); | |||
UChar32 c; | |||
static_assert(sizeof(*str) == sizeof(**value), | |||
"(sizeof(*str) == sizeof(**value)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have an extraneous paren in the string.
Variable was uninitialized in 72547fe Initialize the variable and add a static_check
f8dfec9
to
e0bad1e
Compare
Landed in 2bd850b |
This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport |
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
src
Description of change
Alternative to #9280 ...
The proposed fix in 9280 breaks the calculation algorithm.
Variable was uninitialized in 72547fe Initialize the variable and add a static_check
/cc @bnoordhuis @addaleax