OSDN Git Service

llvm-undname: Fix nullptr deref on invalid conversion operator names in template...
authorNico Weber <nicolasweber@gmx.de>
Mon, 15 Apr 2019 16:42:44 +0000 (16:42 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 15 Apr 2019 16:42:44 +0000 (16:42 +0000)
commit6900134167b2c456705b577d6a9b3b5a455df7e1
treeea0186f7a2346d9760ea4112790ff203effce6ce
parentebe43346ae6421e5a178e1aeae5f685360bc3b89
llvm-undname: Fix nullptr deref on invalid conversion operator names in template args

A ConversionOperatorIdentifierNode has a TargetType which is read when
printing it, but if the ConversionOperatorIdentifierNode appears in a
template argument there's nothing that can provide the TargetType.
Normally the COIN is a symbol (leaf) name and takes its TargetType from the
symbol's type, but in a template argument context the COIN can only be
either a non-leaf name piece or a type, and must hence be invalid.

Similar to the COIN check in demangleDeclarator().

Found by oss-fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358421 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Demangle/MicrosoftDemangle.cpp
test/Demangle/invalid-manglings.test