Skip to content

Commit 1e769e1

Browse files
committed
[Demangler] Eliminate a use-of-uninitialized in misuse of StringRef.
Putting the results of StringRef::data() back into a StringRef scans for the null at the end, which won’t always be there. Caught by ASan.
1 parent 241b4f9 commit 1e769e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Demangling/Context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void Context::clear() {
3636
}
3737

3838
NodePointer Context::demangleSymbolAsNode(llvm::StringRef MangledName) {
39-
if (isMangledName(MangledName.data())) {
39+
if (isMangledName(MangledName)) {
4040
return D->demangleSymbol(MangledName);
4141
}
4242
return demangleOldSymbolAsNode(MangledName, *D);

0 commit comments

Comments
 (0)