Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Correct statement to actually be the intended assert statement.
authorAndres Freund <andres@anarazel.de>
Mon, 14 Dec 2015 10:24:55 +0000 (11:24 +0100)
committerAndres Freund <andres@anarazel.de>
Mon, 14 Dec 2015 10:24:55 +0000 (11:24 +0100)
e3f4cfc7 introduced a LWLockHeldByMe() call, without the corresponding
Assert() surrounding it.

Spotted by Coverity.

Backpatch: 9.1+, like the previous commit

src/backend/storage/buffer/bufmgr.c

index 81b9b29772459b68b7c29de7a812e307cf36177a..8dbe0f169f652e9870788b3fa8af1ec013aafc00 100644 (file)
@@ -2412,7 +2412,7 @@ FlushOneBuffer(Buffer buffer)
 
    bufHdr = &BufferDescriptors[buffer - 1];
 
-   LWLockHeldByMe(bufHdr->content_lock);
+   Assert(LWLockHeldByMe(bufHdr->content_lock));
 
    FlushBuffer(bufHdr, NULL);
 }