[PATCH] D60354: llvm-undname: Fix more crashes and asserts on invalid inputs

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 19:34:27 PDT 2019


thakis created this revision.
thakis added a reviewer: zturner.
Herald added subscribers: erik.pilkington, hiraditya.
Herald added a project: LLVM.

For functions whose callers don't check that enough input is present,
add checks at the start of the function that enough input is there and
set Error otherwise.

For functions that return AST objects, return nullptr instead of
incomplete AST objects with nullptr fields if an error occurred during
the function.

Introduce a new function demangleDeclarator() for the sequence
demangleFullyQualifiedSymbolName(); demangleEncodedSymbol() and
use it in the two places that had this sequence. Let this new function
check that ConversionOperatorIdentifiers have a valid TargetType.

Some of the bad inputs found by oss-fuzz, others by inspection.


https://reviews.llvm.org/D60354

Files:
  llvm/include/llvm/Demangle/MicrosoftDemangle.h
  llvm/lib/Demangle/MicrosoftDemangle.cpp
  llvm/test/Demangle/invalid-manglings.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60354.193998.patch
Type: text/x-patch
Size: 8504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190406/d732a587/attachment.bin>


More information about the llvm-commits mailing list