[Bug c++/109731] g++ evaluates delete expressions more than once

2023-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109731 Jonathan Wakely changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug c++/109731] g++ evaluates delete expressions more than once

2023-05-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109731 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug c++/109731] g++ evaluates delete expressions more than once

2023-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109731 --- Comment #3 from Jonathan Wakely --- It seems that it's considered safe because Token::lexer_ is const, so GCC thinks the value of token->lexer_ can't be changed by the ~Lexer() destructor. That's true, but 'token' can become an invalid point

[Bug c++/109731] g++ evaluates delete expressions more than once

2023-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109731 --- Comment #2 from Jonathan Wakely --- ASan shows the use-after-free: = ==46643==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200010 at pc 0x004010c4 bp 0x7

[Bug c++/109731] g++ evaluates delete expressions more than once

2023-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109731 Jonathan Wakely changed: What|Removed |Added Last reconfirmed||2023-05-04 Status|UNCONFI