]> granicus.if.org Git - clang/commit
Fix crash in codegen on casting to `bool &`.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 7 Oct 2015 10:22:08 +0000 (10:22 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 7 Oct 2015 10:22:08 +0000 (10:22 +0000)
commit78e1baf3d1c63b4a83cb359e3a9c671854a89406
tree770e03509c9163db1927c7d464a6a4e11632e539
parent5bb246bc8462539d05797a475669ba63f72186f1
Fix crash in codegen on casting to `bool &`.
Currently codegen crashes trying to emit casting to bool &. It happens because bool type is converted to i1 and later then lvalue for reference is converted to i1*. But when codegen tries to load this lvalue it crashes trying to load value from this i1*.

Differential Revision: http://reviews.llvm.org/D13325

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249534 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprScalar.cpp
test/CodeGenCXX/cast-to-ref-bool.cpp [new file with mode: 0644]