mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
DebugInfo: Don't crash if 'Debug Info Version' has a strange value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1537,7 +1537,7 @@ bool llvm::StripDebugInfo(Module &M) {
|
||||
}
|
||||
|
||||
unsigned llvm::getDebugMetadataVersionFromModule(const Module &M) {
|
||||
if (auto *Val = mdconst::extract_or_null<ConstantInt>(
|
||||
if (auto *Val = mdconst::dyn_extract_or_null<ConstantInt>(
|
||||
M.getModuleFlag("Debug Info Version")))
|
||||
return Val->getZExtValue();
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user