mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Minor textual corrections
This commit is contained in:
@@ -28,7 +28,8 @@ which then calls <code>recover</code>:
|
||||
</p>
|
||||
<sample src="RedundantRecover1.go" />
|
||||
<p>
|
||||
This problem can be deferring the call to the function which calls<code>recover</code>:
|
||||
This problem can be fixed by deferring the call to the function which calls
|
||||
<code>recover</code>:
|
||||
</p>
|
||||
<sample src="RedundantRecover1Good.go" />
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ where
|
||||
f = recoverCall.getEnclosingCallable() and
|
||||
(
|
||||
isDeferred(recoverCall) and
|
||||
msg = "Deferred calls to 'recover' have no effect"
|
||||
msg = "Deferred calls to 'recover' have no effect."
|
||||
or
|
||||
not isDeferred(recoverCall) and
|
||||
exists(f.getACall()) and
|
||||
not isDeferred(f.getACall()) and
|
||||
msg = "This call to 'recover' has no effect because $@ is never called using a defer statement."
|
||||
)
|
||||
select recoverCall, msg, f, f.getName()
|
||||
select recoverCall, msg, f, "the enclosing function"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
| RedundantRecover1.go:6:5:6:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | RedundantRecover1.go:5:1:9:1 | function declaration | callRecover1 |
|
||||
| RedundantRecover2.go:4:8:4:16 | call to recover | Deferred calls to 'recover' have no effect | RedundantRecover2.go:3:1:6:1 | function declaration | fun2 |
|
||||
| tst.go:8:5:8:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | tst.go:5:1:11:1 | function declaration | callRecover3 |
|
||||
| RedundantRecover1.go:6:5:6:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | RedundantRecover1.go:5:1:9:1 | function declaration | the enclosing function |
|
||||
| RedundantRecover2.go:4:8:4:16 | call to recover | Deferred calls to 'recover' have no effect. | RedundantRecover2.go:3:1:6:1 | function declaration | the enclosing function |
|
||||
| tst.go:8:5:8:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | tst.go:5:1:11:1 | function declaration | the enclosing function |
|
||||
|
||||
Reference in New Issue
Block a user