This is an archive of the discontinued LLVM Phabricator instance.

Fix uninitialized variable in GoParser
ClosedPublic

Authored by teemperor on Jan 20 2018, 1:49 PM.

Details

Summary

m_last_tok isn't initialized anywhere before it's used the first time (most likely in the GoParser::Rule::error method), which causes most of the GoParser tests to fail with sanitizers enabled with errors like this:

GoParser.cpp:52:21: runtime error: load of value <random value>, which is not a valid value for type 'GoLexer::TokenType'
UndefinedBehaviorSanitizer: undefined-behavior GoParser.cpp:52:21

Diff Detail

Event Timeline

teemperor created this revision.Jan 20 2018, 1:49 PM
teemperor edited the summary of this revision. (Show Details)
labath accepted this revision.Jan 22 2018, 3:32 AM
labath added a subscriber: labath.

lgtm (the go plugin is kinda unmaintained now...)

This revision is now accepted and ready to land.Jan 22 2018, 3:32 AM
This revision was automatically updated to reflect the committed changes.

LGTM. FWIW, if people are not maintaining the Go and the Java plugin we should consider removing them entirely.
It's a huge amount of code and if there are no users/developers, it's really not worth the trouble.