IT lexicon › Programming › Return Address

Return Address

Programming På svenska → Updated: 2026-11-13

The memory address where a subroutine should resume execution when it returns, typically stored on the stack or in a register.

When a program jumps to a subroutine via call or jsr (jump-to-subroutine), the current program counter is saved so the subroutine can later return to the correct location. This address is usually stored on the stack (LIFO—last in, first out) so that nested subroutine calls work correctly. Return address handling is one of the most critical mechanisms in all modern processors and is essential for function calls in every programming language.

Stack overflow occurs when return addresses and local variables overwrite each other as the stack grows unchecked. Buffer overflows in C could be exploited by overwriting return addresses to jump to attacker code—this was the source of enormous security vulnerabilities before modern address space layout randomization (ASLR) and stack canaries. Understanding return addresses is crucial to understanding both how functions work and why certain memory safety bugs are catastrophic.

← Back to the lexicon