On Fri, Feb 21, 2025 at 02:20:41PM +0530, Sathvika Vasireddy wrote: > Also, just out of curiosity, how does x86 do it? Does it not use a branch to > next instruction approach?
x86_64 can use LEA like: #define _THIS_IP_ ({ unsigned long __here; asm ("lea 0(%%rip), %0" : "=r" (__here)); __here; }) 32bit needs to call a function, read the stack value and return.