Skip to content

Commit abfa266

Browse files
add hasSuffix check
1 parent 34c1b1d commit abfa266

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ GetDemangledFunctionSuffix(const SymbolContext &sc) {
364364

365365
auto [demangled_name, info] = *info_or_err;
366366

367+
if (!info.hasSuffix())
368+
return llvm::createStringError("Suffix range for '%s' is invalid.",
369+
demangled_name.data());
370+
367371
return demangled_name.slice(info.SuffixRange.first, info.SuffixRange.second);
368372
}
369373

0 commit comments

Comments
 (0)