mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed while(false) loop
This commit is contained in:
parent
35c9cba898
commit
8d3b0d9e59
2 changed files with 17 additions and 1 deletions
|
@ -5490,7 +5490,7 @@ void BfModule::Visit(BfWhileStatement* whileStmt)
|
|||
// For BeefBackend we continue to do CondBr because it helps our flow analysis and we optimize it anyway
|
||||
if ((isInfiniteLoop) && (!IsTargetingBeefBackend()))
|
||||
mBfIRBuilder->CreateBr(bodyBB);
|
||||
else if ((isFalseLoop) && (!IsTargetingBeefBackend()))
|
||||
else if (isFalseLoop)
|
||||
mBfIRBuilder->CreateBr(endBB);
|
||||
else
|
||||
mBfIRBuilder->CreateCondBr(checkVal.mValue, bodyBB, endBB);
|
||||
|
|
16
IDEHelper/Tests/src/Loops.bf
Normal file
16
IDEHelper/Tests/src/Loops.bf
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class Loops
|
||||
{
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
while (false)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue