static6

# static6 - Shape Analysis Static Analysis 2009 Michael I...

This preview shows pages 1–6. Sign up to view the full content.

1 Shape Analysis Shape Analysis Static Analysis 2009 Static Analysis 2009 Michael I. Schwartzbach Computer Science, University of Aarhus

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 2 Static Analysis Looking Into The Heap Looking Into The Heap ± A non-trivial heap structure: ± Deciding disjointness of data structures: •x and y are not disjoint •y and z are disjoint x y z
3 3 Static Analysis Shape Graphs Shape Graphs ± Graphs that describe possible heaps: • nodes are pointer targets • edges are possible pointer references ± The lattice of shape graphs is: 2 Targets × Targets ordered under subset inclusion ± For every CFG node, v, we introduce a constraint variable [[v]] describing the heap after v

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 4 Static Analysis Shape Constraints Shape Constraints ± For pointer operations: id = malloc : [[v]] = JOIN (v) id { ( & id , malloc- i ) } id 1 =& id 2 : [[v]] = JOIN (v) id 1 { ( & id 1 , & id 2 ) } id 1 = id 2 : [[v]] = assign ( JOIN (v), id 1 , id 2 ) id 1 =* id 2 : [[v]] = right ( JOIN (v), id 1 , id 2 ) •* id 1 = id 2 : [[v]] = left ( JOIN (v), id 1 , id 2 ) id =null : [[v]] = JOIN (v) id ± For all other CFG nodes: • [[v]] = JOIN (v)
5 5 Static Analysis Auxiliary Functions Auxiliary Functions ± JOIN (v) = [[w]] ±

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 15

static6 - Shape Analysis Static Analysis 2009 Michael I...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online