Python: IllegalExceptionHandlerType.ql: Autoformats

This commit is contained in:
Rebecca Valentine
2020-03-16 14:48:05 -07:00
parent 5d55db116b
commit 45e47b92a0

View File

@@ -14,17 +14,17 @@
import python
from ExceptFlowNode ex, Value t, ClassValue c, ControlFlowNode origin, string what
where ex.handledException(t, c, origin) and
(
exists(ClassValue x | x = t |
not x.isLegalExceptionType() and
not x.failedInference(_) and
what = "class '" + x.getName() + "'"
)
or
not t instanceof ClassValue and
what = "instance of '" + c.getName() + "'"
)
select ex.getNode(), "Non-exception $@ in exception handler which will never match raised exception.", origin, what
where
ex.handledException(t, c, origin) and
(
exists(ClassValue x | x = t |
not x.isLegalExceptionType() and
not x.failedInference(_) and
what = "class '" + x.getName() + "'"
)
or
not t instanceof ClassValue and
what = "instance of '" + c.getName() + "'"
)
select ex.getNode(),
"Non-exception $@ in exception handler which will never match raised exception.", origin, what