C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Replace an object -- but retain old object if new object fails to construct

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 29 Oct 2025 14:00:10 +0000
On Wed, Oct 29, 2025 at 1:39 PM Giuseppe D'Angelo wrote:
>
> > On an arm64e computer, if you relocate a polymorphic object, and then
> > invoke a virtual method, the attempt to access the vtable will cause a
> > CPU trap because the vtable pointer will be incorrectly encrypted.
>
> This is not the case; the vtable pointer gets correctly re-signed during
> trivial relocation.


Trivial relocation means you can just move the object byte-by-byte
without any further processing. There is no mutation of the bytes --
they are moved verbatim without being edited.

The re-signing isn't a no-op -- it has an observable side effect, and
if you remove that observable side effect then the program will crash
(i.e. the CPU will trap when it tries to dereference an
incorrectly-encrypted pointer).

Received on 2025-10-29 14:00:22