llvm/llvm-project

[MIRSampleProfile] nullptr deref crash when profile sample use file not found

Aperta

#189.764 aperta il 31 mar 2026

 (7 commenti) (0 reazioni) (0 assegnatari)C++ (10.782 fork)batch import
PGOcrash-on-invalidgood first issuellvm:codegen

Metriche repository

Star
 (26.378 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Trying to reproduce https://github.com/llvm/llvm-project/issues/188897, I failed to pass a valid file for -fprofile-sample-use=; this caused a crash because Reader is nullptr in MIRProfileLoader::runOnFunction. Should be easy to guard against this I think. cc @htyu (author of 958a3d8e2dec95a878dfc9d823861b3a6c674534)

Guida contributor