We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parenta6d81b8 commit9c5809aCopy full SHA for 9c5809a
src/include/utils/json_generic.h
@@ -156,14 +156,16 @@ typedef struct Json
156
#undefPG_GETARG_JSONB
157
#definePG_GETARG_JSONB(n)PG_GETARG_JSONX_TMP(n, alloca(sizeof(Json)))/* FIXME conditional alloca() */
158
159
-#definePG_FREE_IF_COPY_JSONB(json,n) \
160
-do { \
161
-if (!VARATT_IS_EXTERNAL_EXPANDED(PG_GETARG_POINTER(n))) \
162
-JsonFree(json); \
163
-else \
164
-Assert(DatumGetEOHP(PG_GETARG_DATUM(n)) == &(json)->obj.eoh); \
165
-} while (0)
+#defineJsonFreeIfCopy(json,datum) \
+do { \
+if (!VARATT_IS_EXTERNAL_EXPANDED(DatumGetPointer(datum))) \
+JsonFree(json); \
+else \
+Assert(DatumGetEOHP(datum) == &(json)->obj.eoh); \
+} while (0)
166
167
+#definePG_FREE_IF_COPY_JSONB(json,n) \
168
+JsonFreeIfCopy(json, PG_GETARG_DATUM(n))
169
170
#defineJsonRoot(json)(&(json)->root)
171
#defineJsonGetSize(json)(JsonRoot(json)->len)