control_flow_graph: Treat empty conditional branch as noop (#3296)

This commit is contained in:
TheTurtle 2025-07-23 06:09:14 +03:00 committed by GitHub
parent de11de43f2
commit 7502739425
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,8 +141,10 @@ void CFG::EmitLabels() {
} else if (inst.IsConditionalBranch()) {
const u32 true_label = inst.BranchTarget(pc);
const u32 false_label = pc + inst.length;
AddLabel(true_label);
AddLabel(false_label);
if (true_label != false_label) {
AddLabel(true_label);
AddLabel(false_label);
}
} else if (inst.opcode == Opcode::S_ENDPGM) {
const u32 next_label = pc + inst.length;
AddLabel(next_label);