This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] NFC Fix uninitialized memory problem
ClosedPublic

Authored by sstwcw on Jun 26 2022, 4:02 AM.

Details

Summary

The setLength function checks for the token kind which could be
uninitialized in the previous version.

The problem was introduced in 2e32ff106e.

Diff Detail

Event Timeline

sstwcw created this revision.Jun 26 2022, 4:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2022, 4:02 AM
sstwcw requested review of this revision.Jun 26 2022, 4:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2022, 4:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This problem was found by the build bot after I pushed the buggy code.
https://lab.llvm.org/buildbot#builders/5/builds/25268
It looks like uninitialized memory was not checked when I ran ninja check-clang-format locally. Am I missing some configuration?

MyDeveloperDay accepted this revision.Jun 26 2022, 7:53 AM
This revision is now accepted and ready to land.Jun 26 2022, 7:53 AM
owenpan accepted this revision.Jun 26 2022, 12:50 PM

Can you remove NFC? IMO, fixing a memory error is not NFC.

This revision was automatically updated to reflect the committed changes.