public inbox for [email protected]  
help / color / mirror / Atom feed
From: ma lz <[email protected]>
To: [email protected] <[email protected]>
Subject: strict-aliasing warning
Date: Wed, 10 Dec 2025 02:27:25 +0000
Message-ID: <TY7PR01MB1485649F37F239834635A33B6F2A0A@TY7PR01MB14856.jpnprd01.prod.outlook.com> (raw)

In function "ExecEvalJsonCoercionFinish()"

     if (SOFT_ERROR_OCCURRED(&jsestate->escontext))

may produce strict-aliasing warning

Don't use IsA may fix this problem


Attachments:

  [application/octet-stream] 1.patch (811B, 3-1.patch)
  download | inline diff:
diff --git a/src/include/nodes/miscnodes.h b/src/include/nodes/miscnodes.h
index bbd1a43c3fb..bdebe5d842a 100644
--- a/src/include/nodes/miscnodes.h
+++ b/src/include/nodes/miscnodes.h
@@ -49,9 +49,16 @@ typedef struct ErrorSaveContext
 	ErrorData  *error_data;		/* details of error, if so */
 } ErrorSaveContext;
 
+static inline bool
+IsErrorSaveContext(const void *ptr)
+{
+	const ErrorSaveContext *esc = (const ErrorSaveContext *) ptr;
+	return esc->type == T_ErrorSaveContext;
+}
+
 /* Often-useful macro for checking if a soft error was reported */
 #define SOFT_ERROR_OCCURRED(escontext) \
-	((escontext) != NULL && IsA(escontext, ErrorSaveContext) && \
+	((escontext) != NULL && IsErrorSaveContext(escontext) && \
 	 ((ErrorSaveContext *) (escontext))->error_occurred)
 
 #endif							/* MISCNODES_H */


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: strict-aliasing warning
  In-Reply-To: <TY7PR01MB1485649F37F239834635A33B6F2A0A@TY7PR01MB14856.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox