On 24.07.24 16:05, Tom Lane wrote:
I'm not very thrilled with these changes. It's not apparent why your compiler is warning about these usages of IsA and not any other ones,
I think one difference is that normally IsA is called on a Node * (since you call IsA to decide what to cast it to), but in this case it's called on a pointer that is already of type ErrorSaveContext *. You wouldn't normally need to call IsA on that, but it comes with the SOFT_ERROR_OCCURRED macro. Another difference is that most nodes are dynamically allocated but in this case the ErrorSaveContext object (not a pointer to it) is part of another struct, and so I think some different aliasing rules might apply, but I'm not sure.
I think here you could just bypass the SOFT_ERROR_OCCURRED macro: - if (SOFT_ERROR_OCCURRED(&jsestate->escontext)) + if (jsestate->escontext.error_occurred)