Skip to content

Commit d77250a

Browse files
committed
C++: Change an 'extends' to an 'instanceof' to make the query compile even if IRGuard is a final class.
1 parent 2778d66 commit d77250a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

c/cert/src/rules/ERR32-C/DoNotRelyOnIndeterminateValuesOfErrno.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ import semmle.code.cpp.controlflow.Guards
2020
* A check on `signal` call return value
2121
* `if (signal(SIGINT, handler) == SIG_ERR)`
2222
*/
23-
class SignalCheckOperation extends EqualityOperation, GuardCondition {
23+
class SignalCheckOperation extends EqualityOperation instanceof GuardCondition {
2424
BasicBlock errorSuccessor;
2525

2626
SignalCheckOperation() {
2727
this.getAnOperand() = any(MacroInvocation m | m.getMacroName() = "SIG_ERR").getExpr() and
2828
(
2929
this.getOperator() = "==" and
30-
this.controls(errorSuccessor, true)
30+
super.controls(errorSuccessor, true)
3131
or
3232
this.getOperator() = "!=" and
33-
this.controls(errorSuccessor, false)
33+
super.controls(errorSuccessor, false)
3434
)
3535
}
3636

0 commit comments

Comments
 (0)