OSDN Git Service

[PR37339] Fix assertion in FunctionComparator::cmpInlineAsm
authorwhitequark <whitequark@whitequark.org>
Thu, 10 May 2018 15:05:47 +0000 (15:05 +0000)
committerwhitequark <whitequark@whitequark.org>
Thu, 10 May 2018 15:05:47 +0000 (15:05 +0000)
commit0ccb7f4a4d99b0381cffc4175f1fc34ddb0085bc
tree3396199f6a4032b23a1188383cac954ecd35858f
parentf9bd414b6dd0fead7aa2109281de62819bffa328
[PR37339] Fix assertion in FunctionComparator::cmpInlineAsm

Fixes bug https://bugs.llvm.org/show_bug.cgi?id=37339.

InlineAsm is only uniqued if the FunctionTypes are exactly the
same, while cmpTypes() for example considers all pointer types
in the default address space to be the same. For this reason
the end of cmpInlineAsm() can be reached.

This patch replaces the unreachable assertion with a check that
the function types are not identical.

Differential Revision: https://reviews.llvm.org/D46495

Reviewers: jfb

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331990 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/FunctionComparator.cpp
test/Transforms/MergeFunc/inline-asm.ll [new file with mode: 0644]