The return address is not necessarily a function pointer.
Typically the return address is within a function with the stackframe set up, etc.
Those functions - as you show them - would be called from within the function, which would return, itself?
If you intend to first go to a different function and then jumping back to the original calling function, why not specifying this directly? Or first call the intermediate function and then return?
-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Do 28.11.2024 23:17
Betreff: Re: [std-proposals] #include <debug>
An: std-proposals@lists.isocpp.org;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;
On Thu, Nov 28, 2024 at 5:39 PM Thiago Macieira wrote:
>
> That makes even less sense. How can you have a reference to a register?
Having put more thought into it, it would have to be two separate functions:
auto get_return_address(void) -> void (*)(void);
void set_return_address( void (*)(void) );
You mentioned Control Flow Enforcement -- which by the way I've never
encountered -- but of course you would turn that off when debugging.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals