]> git.lizzy.rs Git - rust.git/commit
Fix an ICE when translating `if loop {} {}`
authorBjörn Steinbrink <bsteinbr@gmail.com>
Thu, 19 Feb 2015 09:49:14 +0000 (10:49 +0100)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Thu, 19 Feb 2015 10:46:47 +0000 (11:46 +0100)
commit07c0faa4070b13f7b59134ecd23f5810852319af
treeaa7711739ca76b371d5bae168f663fbf25246673
parent22992358bc74956f53b1a2ab99ae245cd3ca5550
Fix an ICE when translating `if loop {} {}`

In `if loop {} {}`, the `if` is actually unreachable, but we didn't
handle that correctly and when trying to translate the `if` we tried to
branch on the "return value" of the loop expression, which is not an
`i1` and therefore triggered an LLVM assertion.
src/librustc_trans/trans/controlflow.rs
src/test/compile-fail/if-loop.rs [new file with mode: 0644]