Skip to content

Commit ac4920e

Browse files
committed
LLVMTypeAnalyzer: Fix else branch handling in branchStart()
1 parent f9afdfc commit ac4920e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/engine/internal/llvm/llvmtypeanalyzer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,14 @@ LLVMInstruction *LLVMTypeAnalyzer::branchStart(LLVMInstruction *end) const
269269
LLVMInstruction *ins = end->previous;
270270
int level = 0;
271271

272-
while (ins && !((isLoopStart(ins) || isIfStart(ins)) && level == 0)) {
272+
while (ins && !((isLoopStart(ins) || isIfStart(ins) || isElse(ins)) && level == 0)) {
273273
if (isLoopStart(ins) || isIfStart(ins)) {
274274
assert(level > 0);
275275
level--;
276276
}
277277

278-
if (isLoopEnd(ins) || isIfEnd(ins) || isElse(ins)) {
279-
if (isElse(ins) && level == 0)
280-
break;
281-
278+
if (isLoopEnd(ins) || isIfEnd(ins))
282279
level++;
283-
}
284280

285281
ins = ins->previous;
286282
};

0 commit comments

Comments
 (0)