Merge pull request #20779 from MathiasVP/fix-bad-magic

C++: Fix bad magic in `IRGuards`
This commit is contained in:
Mathias Vorreiter Pedersen
2025-11-10 10:05:18 +00:00
committed by GitHub

View File

@@ -703,6 +703,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
) )
} }
pragma[nomagic]
override predicate comparesLt( override predicate comparesLt(
Cpp::Expr left, Cpp::Expr right, int k, boolean isLessThan, boolean testIsTrue Cpp::Expr left, Cpp::Expr right, int k, boolean isLessThan, boolean testIsTrue
) { ) {
@@ -713,6 +714,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
) )
} }
pragma[nomagic]
override predicate comparesLt(Cpp::Expr e, int k, boolean isLessThan, GuardValue value) { override predicate comparesLt(Cpp::Expr e, int k, boolean isLessThan, GuardValue value) {
exists(GuardValue partValue, GuardCondition part | exists(GuardValue partValue, GuardCondition part |
this.(Cpp::BinaryLogicalOperation) this.(Cpp::BinaryLogicalOperation)
@@ -738,6 +740,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
) )
} }
pragma[nomagic]
override predicate comparesEq( override predicate comparesEq(
Cpp::Expr left, Cpp::Expr right, int k, boolean areEqual, boolean testIsTrue Cpp::Expr left, Cpp::Expr right, int k, boolean areEqual, boolean testIsTrue
) { ) {
@@ -757,6 +760,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
) )
} }
pragma[nomagic]
override predicate comparesEq(Cpp::Expr e, int k, boolean areEqual, GuardValue value) { override predicate comparesEq(Cpp::Expr e, int k, boolean areEqual, GuardValue value) {
exists(GuardValue partValue, GuardCondition part | exists(GuardValue partValue, GuardCondition part |
this.(Cpp::BinaryLogicalOperation) this.(Cpp::BinaryLogicalOperation)