On 12/9/20 2:28 PM, Dimitry Sibiryakov wrote:
09.12.2020 12:21, Alex Peshkoff via Firebird-devel wrote:
During such self assignment returned pointer can be invalidated by
setErrors() code before using input parameter which may cause crash
or wrong result.
Builtin implementation works fine with your particular sample.
Not quite so. It works only because both errors and warning vectors
used to be empty at that point so the pointers are point to the inline
storage. If heap storage is used (for example after
IProvider::attachDatabase() returned massive warnings), call to
clean() in setWarnings() will invalidate the pointer.
setWarnings() does not use clear(), it's using save() internal call
which does invalidates memory in the very end and therefore is safe
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel