| commit | eac7466448f920e733f12beca28ff848cfa4810d | [log] [tgz] |
|---|---|---|
| author | Alexey Karyakin <akaryaki@quicinc.com> | Wed May 14 10:33:57 2025 -0500 |
| committer | GitHub <noreply@github.com> | Wed May 14 10:33:57 2025 -0500 |
| tree | 6dfdc9d6ae7f09c5116878d2fb50888f67337ce0 | |
| parent | ee47454bb8be7f4cd1ecbd862c5a82d24ef696c7 [diff] |
[LTO] Fix a crash with thin LTO caching and asm output (#138203) The `CacheStream::commit()` function (defined in Caching.cpp) deletes the underlying raw stream. Some output streamers may hold a pointer to it, which then will outlive the stream object. In particular, MCAsmStreamer keeps the pointer to the raw stream though a separate `formatted_raw_stream` object, which buffers data and there is no path to explicitly flush this data. Before this change, the buffered data was flushed during the MCAsmStreamer destructor. After #136121, this happened after the `commit()` function is called. Therefore, it caused a crash because the `formatted_raw_stream` object tries to write the buffered data into a deleted raw stream. Even if we don't delete the stream to avoid the crash, it would be too late as the output stream cannot accept data after commit(). Fixes: #138194.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.