C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standardising 0xdeadbeef for pointers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 26 Jul 2025 20:47:08 -0700
On Saturday, 26 July 2025 18:06:13 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> I wonder if this is so that a debugger can, if it wants to, zero out
> the bytes of any object after its destroyed?

Not a regular debugger. They usually can't tell a destructor from another
function. Something like ASan could do it, because it's applied when C++
semantics are still present. Some debug memory allocators do overwrite freed
memory. GCC at some point got options to zero out registers and even stack in
some security-sensitive functions.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-07-27 03:47:11