[Bug c++/106965] g++ optimization removes assigning 0 to deleted pointer- causes double free.

2022-09-20 Thread olddra3rd at mozmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106965 --- Comment #4 from Boaz --- (In reply to Jonathan Wakely from comment #3) > (In reply to Richard Biener from comment #1) > > I think it's undefined to invoke a DTOR twice which is what you do here. > > After the DTOR the m_ptr member becomes u

[Bug c++/106965] g++ optimization removes assigning 0 to deleted pointer- causes double free.

2022-09-19 Thread olddra3rd at mozmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106965 --- Comment #2 from Boaz --- (In reply to Richard Biener from comment #1) > I think it's undefined to invoke a DTOR twice which is what you do here. > After the DTOR the m_ptr member becomes undefined so re-evaluating that in > the second invoc

[Bug c++/106965] New: g++ optimization removes assigning 0 to deleted pointer- causes double free.

2022-09-19 Thread olddra3rd at mozmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106965 Bug ID: 106965 Summary: g++ optimization removes assigning 0 to deleted pointer- causes double free. Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: