Skip to content

Commit 84f02ea

Browse files
committed
RequirementMachine: Fix crash in simplifyRewriteSystem() with -debug-requirement-machine=completion
If we're not recording homotopy generators, we can't access HomotopyGenerators.back() in the debug output.
1 parent bcf5e97 commit 84f02ea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/AST/RequirementMachine/RewriteSystem.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,13 @@ void RewriteSystem::simplifyRewriteSystem() {
398398
loop.add(RewriteStep::forRewriteRule(/*startOffset=*/0, /*endOffset=*/0,
399399
newRuleID, /*inverse=*/true));
400400

401-
recordHomotopyGenerator(MutableTerm(lhs), loop);
402-
403401
if (Debug.contains(DebugFlags::Completion)) {
404-
llvm::dbgs() << "$ Right hand side simplification recorded a loop: ";
405-
HomotopyGenerators.back().dump(llvm::dbgs(), *this);
402+
llvm::dbgs() << "$ Right hand side simplification recorded a loop at ";
403+
llvm::dbgs() << lhs << ": ";
404+
loop.dump(llvm::dbgs(), MutableTerm(lhs), *this);
406405
}
406+
407+
recordHomotopyGenerator(MutableTerm(lhs), loop);
407408
}
408409
}
409410

0 commit comments

Comments
 (0)