postgrespro.git / summary / log / commit / refs

commit    d51f704fd8cbae03cd9b29fe103dd027d521ff04
Author:   Peter Eisentraut <peter@eisentraut.org>
Date:     Mon Apr 27 12:24:20 2020 +0000

    pg_dump: Replace can't-happen error with assertion


src/bin/pg_dump/pg_backup_tar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 775118f297..d5bfa55646 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -515,6 +515,8 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh) size_t used = 0; size_t res = 0; + Assert(th || fh); + avail = AH->lookaheadLen - AH->lookaheadPos; if (avail > 0) { @@ -567,8 +569,6 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh) READ_ERROR_EXIT(th->nFH); } } - else - fatal("internal error -- neither th nor fh specified in _tarReadRaw()"); } ctx->tarFHpos += res + used; [parent: 641b76d9d12f]