Static Analysis for Stack Inspection