carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
https://github.com/carbon-language/carbon-lang/blob/trunk/README.md
Other
32.31k stars 1.48k forks source link

Fix some subtle UB found by MSan. #4093

Closed chandlerc closed 2 days ago

chandlerc commented 2 days ago

Technically, any small size buffer's lifetime has ended by the time we get to the base's destructor. This means its no longer valid to access table contents if stored there from the base destructor. We need to handle destruction in the table class instead.

This ends up being a trivial change because the logic is already factored out, we just need to call it from a different point.