mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
This commit is contained in:
@@ -398,12 +398,13 @@ void RewriteSystem::simplifyRewriteSystem() {
|
||||
loop.add(RewriteStep::forRewriteRule(/*startOffset=*/0, /*endOffset=*/0,
|
||||
newRuleID, /*inverse=*/true));
|
||||
|
||||
recordHomotopyGenerator(MutableTerm(lhs), loop);
|
||||
|
||||
if (Debug.contains(DebugFlags::Completion)) {
|
||||
llvm::dbgs() << "$ Right hand side simplification recorded a loop: ";
|
||||
HomotopyGenerators.back().dump(llvm::dbgs(), *this);
|
||||
llvm::dbgs() << "$ Right hand side simplification recorded a loop at ";
|
||||
llvm::dbgs() << lhs << ": ";
|
||||
loop.dump(llvm::dbgs(), MutableTerm(lhs), *this);
|
||||
}
|
||||
|
||||
recordHomotopyGenerator(MutableTerm(lhs), loop);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user