OSDN Git Service

Fix crash in MCExpr::print.
authorPete Cooper <peter_cooper@apple.com>
Fri, 29 May 2015 17:19:11 +0000 (17:19 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 29 May 2015 17:19:11 +0000 (17:19 +0000)
commitb2faffd63aa29617402aad745d8aabbd60f67a96
tree67eefa025a8b9c546ee9fcad2c084231e83d87cd
parent8493722975059cbc7bb00f1eb4d6d15c47e0faed
Fix crash in MCExpr::print.

Symbols are no longer required to be named, but this leads to a crash here if an
unnamed symbol checks that its first character is '$'.

Change the code to first check for a name, then check its first character.

No test case i'm afraid as this is debugging code, but any test case with temp labels
and 'llc --debug --filetype=obj' would have crashed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238579 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCExpr.cpp