Unit 1e – Procedures and Stack

Local Variables and Arguments

 

Local Variables and Recusion

 
 

Life of a Local Variable / Argument

Procedure Activation

Heap vs Allocation Frames

Runtime Stack

What is Stored in the Activation Frame?

Stack Frame Layout

Accessing a Local Variable or Argument

Some Implications

 
 

Procedure Prologue

Division of Labour

Example

 

Creating the Stack

Question

Arguments

Return Value and Optimizations

 

Summary: Local Variables

Vulnerability in Buffer Overlow

The Buffer Overflow Bug

Changing the Return Addresss

Stack-Smash Attack String

Protecting from Buffer Overflow