Skip to content

Commit f7082f2

Browse files
committed
Fix bogus Assert, per buildfarm results.
1 parent 172eacb commit f7082f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

contrib/hstore/hstore_op.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/hstore/hstore_op.c,v 1.14 2009/09/30 19:50:22 tgl Exp $
2+
* $PostgreSQL: pgsql/contrib/hstore/hstore_op.c,v 1.15 2009/09/30 21:26:17 tgl Exp $
33
*/
44
#include "postgres.h"
55

@@ -1236,8 +1236,10 @@ hstore_hash(PG_FUNCTION_ARGS)
12361236
* but we make it explicit here.
12371237
*/
12381238
Assert(VARSIZE(hs) ==
1239-
CALCDATASIZE(HS_COUNT(hs),
1240-
HSE_ENDPOS(ARRPTR(hs)[2*HS_COUNT(hs) - 1])));
1239+
(HS_COUNT(hs) != 0 ?
1240+
CALCDATASIZE(HS_COUNT(hs),
1241+
HSE_ENDPOS(ARRPTR(hs)[2*HS_COUNT(hs) - 1])) :
1242+
HSHRDSIZE));
12411243

12421244
PG_FREE_IF_COPY(hs,0);
12431245
PG_RETURN_DATUM(hval);

0 commit comments

Comments
 (0)