Re: [Firebird-devel] Errors vector lifetime

2020-12-09 Thread Dimitry Sibiryakov
09.12.2020 12:41, Alex Peshkoff via Firebird-devel wrote: setWarnings() does not use clear(), it's using save() internal call which does invalidates memory in the very end and therefore is safe Ah, I see. I looked at wrong save() overload. -- WBR, SD. Firebird-Devel mailing list, web int

Re: [Firebird-devel] Errors vector lifetime

2020-12-09 Thread Alex Peshkoff via Firebird-devel
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

Re: [Firebird-devel] Errors vector lifetime

2020-12-09 Thread Dimitry Sibiryakov
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.

Re: [Firebird-devel] Errors vector lifetime

2020-12-09 Thread Alex Peshkoff via Firebird-devel
On 12/9/20 2:03 PM, Dimitry Sibiryakov wrote: 18.11.2020 17:49, Dimitry Sibiryakov wrote:    How long pointer returned from IStatus::getErrors() is supposed to be valid?   I think I found a weird case. In Y-valve there is code like this:   status.setErrors(status.getErrors());   During such

Re: [Firebird-devel] Errors vector lifetime

2020-12-09 Thread Dimitry Sibiryakov
18.11.2020 17:49, Dimitry Sibiryakov wrote:   How long pointer returned from IStatus::getErrors() is supposed to be valid? I think I found a weird case. In Y-valve there is code like this: status.setErrors(status.getErrors()); During such self assignment returned pointer can be invalid

Re: [Firebird-devel] Errors vector lifetime

2020-11-18 Thread Alex Peshkoff via Firebird-devel
On 11/18/20 7:49 PM, Dimitry Sibiryakov wrote: Hello All.   How long pointer returned from IStatus::getErrors() is supposed to be valid?   Until the next call of init()?   Until the next call of setErrors()?   Until the next call of getErrors()? Always supposed that until any call, changing

[Firebird-devel] Errors vector lifetime

2020-11-18 Thread Dimitry Sibiryakov
Hello All. How long pointer returned from IStatus::getErrors() is supposed to be valid? Until the next call of init()? Until the next call of setErrors()? Until the next call of getErrors()? -- WBR, SD. Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/li