This is an archive of the discontinued LLVM Phabricator instance.

Fix memory leaks in GoParser
ClosedPublic

Authored by teemperor on Jan 23 2018, 12:01 AM.

Details

Summary

The GoParser is leaking memory in the tests due to not freeing allocated nodes when encountering some parsing errors. With this patch all GoParser tests are passing with enabled memory sanitizers/ubsan.

Diff Detail

Repository
rL LLVM

Event Timeline

teemperor created this revision.Jan 23 2018, 12:01 AM
labath accepted this revision.Jan 23 2018, 2:07 AM

It looks like all of these parsing functions would benefit from returning unique_ptr, but that's probably not something we should bother doing now that we are contemplating removing this code.

This revision is now accepted and ready to land.Jan 23 2018, 2:07 AM
This revision was automatically updated to reflect the committed changes.