Fix compiler warning in back branches (9.6, 10).
authorThomas Munro <[email protected]>
Tue, 16 Feb 2021 00:10:37 +0000 (13:10 +1300)
committerThomas Munro <[email protected]>
Tue, 16 Feb 2021 00:17:07 +0000 (13:17 +1300)
Back-patch a tiny bit of commit fbb2e9a0 into 9.6 and 10, to silence an
uninitialized variable warning from GCC 10.2.  Seen on buildfarm member
handfish, and my own development workflow where I like to use -Werror.

Discussion: https://postgr.es/m/CA%2BhUKGJRcwvK86Uf5t-FrTekZjqHtpv3u%3D3MuBg8Zw8R933Mqg%40mail.gmail.com

src/backend/utils/misc/guc.c

index ae4be7724e324bbb675f6d579cadf1dd8d995c5a..2974ca6dd82960aa42b207320496e9d9d45ed0b5 100644 (file)
@@ -9325,6 +9325,8 @@ RestoreGUCState(void *gucstate)
        if (varsourcefile[0])
            read_gucstate_binary(&srcptr, srcend,
                                 &varsourceline, sizeof(varsourceline));
+       else
+           varsourceline = 0;
        read_gucstate_binary(&srcptr, srcend,
                             &varsource, sizeof(varsource));
        read_gucstate_binary(&srcptr, srcend,