mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
Prevent re-specializing an helper in the same way
This commit is contained in:
@@ -313,6 +313,20 @@ bool CorrectCPUStateUsagePass::runOnModule(Module& TheModule) {
|
||||
// If the callee was already a specialization, preserve its
|
||||
// specialized arguments
|
||||
if (CurrentSpecialization != Specializations.end()) {
|
||||
|
||||
// Check if we're good with this specialization
|
||||
bool SpecializationMatches = false;
|
||||
for (auto &P : CurrentSpecialization->SpecializedArgs) {
|
||||
if (P.first == TheUse.getOperandNo()) {
|
||||
assert(P.second == CurrentOffset);
|
||||
SpecializationMatches = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (SpecializationMatches)
|
||||
continue;
|
||||
|
||||
Original = CurrentSpecialization->Original;
|
||||
SpecializedArgs = CurrentSpecialization->SpecializedArgs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user