• No results found

Pointer Analysis

N/A
N/A
Protected

Academic year: 2022

Share "Pointer Analysis"

Copied!
115
0
0

Loading.... (view fulltext now)

Full text

(1)

CS618: Program Analysis 2016-17 I

st

Semester

Pointer Analysis

Amey Karkare

karkare@cse.iitk.ac.in karkare@cse.iitb.ac.in

Department of CSE, IIT Kanpur/Bombay

(2)

Why Pointer Analysis?

Static analysis of pointers & references

S1. . . .

S2. q=p;

S3. do{

S4. q=q.next; S5. }while(. . .) S6. p.data=r1;

S7. q.data=q.data+r2;

S8. p.data=r1;

S9. r3=p.data+r2;

S10. . . .

p q

m1 m2 m3 mk

p next next

q q

q

Stack Heap

Superimposition of memory graphs afterdo-whileloop

pandqare definitely not aliases statement S6 onwards.

Statement S8 isredundant.

(3)

Why Pointer Analysis?

Static analysis of pointers & references

S1. . . .

S2. q=p;

S3. while(. . .){ S4. q=q.next; S5. }

S6. p.data=r1;

S7. q.data=q.data+r2;

S8. p.data=r1;

S9. r3=p.data+r2;

S10. . . .

p q

m1 m2 m3 mk

p next next

q q q

q

Stack Heap

Superimposition of memory graphs afterwhileloop

pandqmay be aliases statement S6 onwards.

Statement S8 is notredundant.

(4)

Why Pointer Analysis?

x = &a;

a = 5; *x = 15;

c = a + 1;

Reaching definitions analysis

(5)

Why Pointer Analysis?

x = &a;

a = 5; *x = 15;

c = a + 1;

Reaching definitions analysis

Which defs ofareach here?

(6)

Flow Sensitivity in Data Flow Analysis

Flow Sensitive Analysis

(7)

Flow Sensitivity in Data Flow Analysis

Flow Sensitive Analysis

Order of execution: Determined by the semantics of language

(8)

Flow Sensitivity in Data Flow Analysis

Flow Sensitive Analysis

Order of execution: Determined by the semantics of language

Point-specific information computed at each program point within a procedure

(9)

Flow Sensitivity in Data Flow Analysis

Flow Sensitive Analysis

Order of execution: Determined by the semantics of language

Point-specific information computed at each program point within a procedure

A statement can “override” information computed by a previous statement

(10)

Flow Sensitivity in Data Flow Analysis

Flow Sensitive Analysis

Order of execution: Determined by the semantics of language

Point-specific information computed at each program point within a procedure

A statement can “override” information computed by a previous statement

Killcomponent in the flow function

(11)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

(12)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

(13)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

As a result, all the program points in a procedure receive identical data flow information.

(14)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

As a result, all the program points in a procedure receive identical data flow information.

“Summary” for the procedure

(15)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

As a result, all the program points in a procedure receive identical data flow information.

“Summary” for the procedure

Safe approximation of flow-sensitive point-specific information for any point, for any given execution order

(16)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

As a result, all the program points in a procedure receive identical data flow information.

“Summary” for the procedure

Safe approximation of flow-sensitive point-specific information for any point, for any given execution order A statement can not “override” information computed by another statement

(17)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

As a result, all the program points in a procedure receive identical data flow information.

“Summary” for the procedure

Safe approximation of flow-sensitive point-specific information for any point, for any given execution order A statement can not “override” information computed by another statement

NOKill component in the flow function

(18)

Flow Sensitivity in Data Flow Analysis

Flow Insensitive Analysis

Order of execution: Statements are assumed to execute in any order

As a result, all the program points in a procedure receive identical data flow information.

“Summary” for the procedure

Safe approximation of flow-sensitive point-specific information for any point, for any given execution order A statement can not “override” information computed by another statement

NOKill component in the flow function

If statementskills some data flow information, there is an alternate path that excludess

(19)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

(20)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

Compute/Verify type of a variable/expression

(21)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

Compute/Verify type of a variable/expression Address taken analysis

(22)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

Compute/Verify type of a variable/expression Address taken analysis

Which variables have their addresses taken?

(23)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

Compute/Verify type of a variable/expression Address taken analysis

Which variables have their addresses taken?

A very simple form of pointer analysis

(24)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

Compute/Verify type of a variable/expression Address taken analysis

Which variables have their addresses taken?

A very simple form of pointer analysis Side effects analysis

(25)

Examples of Flow Insensitive Analyses

Type checking, Type inferencing

Compute/Verify type of a variable/expression Address taken analysis

Which variables have their addresses taken?

A very simple form of pointer analysis Side effects analysis

Does a procedure modify address / global variable / reference parameter / . . . ?

(26)

Realizing Flow Insensitivity

b0

b1

b2 b3

b4

b5

(27)

Realizing Flow Insensitivity

b0

b1

b2 b3

b4

b5

ENTRY

b0 b1 b2 b3 b4 b5

EXIT

(28)

Realizing Flow Insensitivity

b0

b1

b2 b3

b4

b5

ENTRY

b0 b1 b2 b3 b4 b5

EXIT

Allows arbitrary compositions of flow functions in any orderFlow insensitivity

(29)

Realizing Flow Insensitivity

b0

b1

b2 b3

b4

b5

ENTRY

b0 b1 b2 b3 b4 b5

EXIT

In practice, dependent constraints are collected in a global repository in one pass and solved independently

(30)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

(31)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

(32)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive?

(33)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive? No Yes

(34)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive? No Yes

Symmetric?

(35)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive? No Yes

Symmetric? No Yes

(36)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive? No Yes

Symmetric? No Yes

Transitive?

(37)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive? No Yes

Symmetric? No Yes

Transitive? No

(38)

Alias Analysis vs. Points-to Analysis

Points-to Analysis Alias Analysis

x = &a x = a

x points-to a x and a are aliases

x→a x≡a

Reflexive? No Yes

Symmetric? No Yes

Transitive? No Must alias: Yes,

May alias: No

(39)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint

(40)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint

(41)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint

1 Pa⊇ {b} a b

(42)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint 1 Pa⊇ {b}

2 PcPa

a

c

b

(43)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint 1 Pa⊇ {b}

2 PcPa

3 Pa⊇ {d}

a

c

b d

(44)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint 1 Pa⊇ {b}

2 PcPa

3 Pa⊇ {d} 4 Pa⊇ {e}

a

c

b d e

(45)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint 1 Pa⊇ {b}

2 PcPa

3 Pa⊇ {d} 4 Pa⊇ {e}

5 PbPa

a

c

b d e b

(46)

Andersen’s Flow Insensitive Points-to Analysis

Subset based analysis PlhsPrhs

Program Constraints Points-to Graph

1 a = &b

2 c = a

3 a = &d 4 a = &e

5 b = a

# Constraint 1 Pa⊇ {b}

2 PcPa

3 Pa⊇ {d} 4 Pa⊇ {e}

5 PbPa

a

c

b d

e

(47)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph 1 a = &b

2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint

(48)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph 1 a = &b

2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint 1 Pa⊇ {b}

a b

(49)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph

1 a = &b 2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint 1 Pa⊇ {b}

2 MERGE(Pc,Pa)

a

c

b

(50)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph

1 a = &b 2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint 1 Pa⊇ {b}

2 MERGE(Pc,Pa) 3 Pa⊇ {d}

a

c

b d

(51)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph

1 a = &b 2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint 1 Pa⊇ {b}

2 MERGE(Pc,Pa) 3 Pa⊇ {d}

4 Pa⊇ {e}

a

c

b d e

(52)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph

1 a = &b 2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint 1 Pa⊇ {b}

2 MERGE(Pc,Pa) 3 Pa⊇ {d}

4 Pa⊇ {e}

5 MERGE(Pb,Pa)

a

c

b d e

(53)

Steensgaard’s Flow Insensitive Points-to Analysis

Equality based analysis:PlhsPrhs

Only one Points-to successor at any time, merge (potential) multiple successors

Program Constraints Points-to Graph

1 a = &b 2 c = a

3 a = &d 4 a = &e 5 b = a

# Constraint 1 Pa⊇ {b}

2 MERGE(Pc,Pa) 3 Pa⊇ {d}

4 Pa⊇ {e}

5 MERGE(Pb,Pa)

a

c

b d

e

(54)

Comparing Anderson’s and Steensgaard’s Analyses

Program Subset based Equality based Points-to Graph Points-to Graph a = &b

c = a

a = &d a = &e b = a

a

c

b d

e a

c

b d

e

(55)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

(56)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

(57)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

b = &c;

(58)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

b = &c;

a b c

(59)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

b = &c;

a b c

d = &e;

(60)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

b = &c;

a b c

d = &e;

a b c

d e

(61)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

b = &c;

a b c

d = &e;

a b c

d e

a = &d;

(62)

Comparing Anderson’s and Steensgaard’s Analyses

a = &b;

a b

b = &c;

a b c

d = &e;

a b c

d e

a = &d;

Subset based Equality based

a

b c

d e

a b,c d,e

(63)

Pointer Indirection Constraints

Stmt Subset based Equality based a = *b PaPc,∀c ∈Pb MERGE(Pa,Pc),∀c∈Pb

*a = b PcPb,∀c ∈Pa MERGE(Pb,Pc),∀c∈Pa

(64)

Must Points-to Analysis

1 x = &a;

2 3

4

x definitelypoints-toaat various points in the program xD a

(65)

May Points-to Analysis

1 x = &a;

2 x = &b; 3

4

At OUT of 2,x definitely points-tob At OUT of 3,x definitely points-toa At IN of 4,x possiblypoints-toa(orb)

x P a,x P b

(66)

May Points-to Analysis

1 x = &a;

2 x = &b; 3

4

At OUT of 2,x definitely points-tob At OUT of 3,x definitely points-toa At IN of 4,x possiblypoints-toa(orb)

x → {a,P b}

(67)

Must Alias Analysis

1 x =a;

2 3

4 y =a;

x andaalways refer to same memory location xDa

(68)

Must Alias Analysis

1 x =a;

2 3

4 y =a;

x andaalways refer to same memory location xDa

x,y andarefer to same location at OUT of 4.

xDyDa

(69)

May Alias Analysis

1 x =a;

2 x =b; 3

4

At OUT of 2,x andbare must aliases At OUT of 3,x andaare must aliases

At IN of 4,x canpossiblybe aliased with eithera(orb) x Pa,x Pb

(70)

May Alias Analysis

1 x =a;

2 x =b; 3

4

At OUT of 2,x andbare must aliases At OUT of 3,x andaare must aliases

At IN of 4,x canpossiblybe aliased with eithera(orb) (x,a),(x,b)

(71)

May Alias Analysis

1 x =a;

2 x =b; 3

4

At OUT of 2,x andbare must aliases At OUT of 3,x andaare must aliases

At IN of 4,x canpossiblybe aliased with eithera(orb) (x,a),(x,b)

If we say: (x,a,b), Is itPrecise?

(72)

May Alias Analysis

1 x =a;

2 x =b; 3

4

At OUT of 2,x andbare must aliases At OUT of 3,x andaare must aliases

At IN of 4,x canpossiblybe aliased with eithera(orb) (x,a),(x,b)

If we say: (x,a,b), Is itPrecise? Safe?

(73)

Must Pointer Analysis

Makes sense only for Flow Sensitive analysis

(74)

Must Pointer Analysis

Makes sense only for Flow Sensitive analysis Why?

(75)

Must Pointer Analysis

Makes sense only for Flow Sensitive analysis Why?

Must analysis⇒Flow sensitive analysis

(76)

Must Pointer Analysis

Makes sense only for Flow Sensitive analysis Why?

Must analysis⇒Flow sensitive analysis Flow insensitive analysis⇒May analysis

(77)

Must Pointer Analysis

Makes sense only for Flow Sensitive analysis Why?

Must analysis⇒Flow sensitive analysis Flow insensitive analysis⇒May analysis Why?

(78)

Updating Information: When Can WeKill?

Never if flow insensitive analysis

(79)

Updating Information: When Can WeKill?

Never if flow insensitive analysis For flow sensitive

1x= &a;

2 y= &b;

w= &c;

3z= &x; 4z= &y;

5 ∗z=NULL;

∗w=NULL;

(80)

Updating Information: When Can WeKill?

Never if flow insensitive analysis For flow sensitive

1x= &a;

2 y= &b;

w= &c;

3z= &x; 4z= &y;

5 ∗z=NULL;

∗w=NULL;

x,y may or may not get modified in 5: Weakupdate

(81)

Updating Information: When Can WeKill?

Never if flow insensitive analysis For flow sensitive

1x= &a;

2 y= &b;

w= &c;

3z= &x; 4z= &y;

5 ∗z=NULL;

∗w=NULL;

x,y may or may not get modified in 5: Weakupdate c definitely gets modified in 5:Strong update

(82)

Updating Information: When Can WeKill?

Never if flow insensitive analysis For flow sensitive

1x= &a;

2 y= &b;

w= &c;

3z= &x; 4z= &y;

5 ∗z=NULL;

∗w=NULL;

x,y may or may not get modified in 5: Weakupdate c definitely gets modified in 5:Strong update

Must information is killed by Strong and Weak updates

(83)

Updating Information: When Can WeKill?

Never if flow insensitive analysis For flow sensitive

1x= &a;

2 y= &b;

w= &c;

3z= &x; 4z= &y;

5 ∗z=NULL;

∗w=NULL;

x,y may or may not get modified in 5: Weakupdate c definitely gets modified in 5:Strong update

Must information is killed by Strong and Weak updates May information is killed only by Strong updates

(84)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation

(85)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

(86)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y

(87)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

(88)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

*x = y

(89)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

*x = y

Other statements can be rewritten in terms of above

(90)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

*x = y

Other statements can be rewritten in terms of above

*x = *yt = *y, *x = t

(91)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

*x = y

Other statements can be rewritten in terms of above

*x = *yt = *y, *x = t

x = NULLtreat NULL as a special variable

(92)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

*x = y

Other statements can be rewritten in terms of above

*x = *yt = *y, *x = t

x = NULLtreat NULL as a special variable OUT =INkillgen

(93)

Flow Functions for Points-to Analysis

Basic statements for pointer manipulation x = y

x = &y x = *y

*x = y

Other statements can be rewritten in terms of above

*x = *yt = *y, *x = t

x = NULLtreat NULL as a special variable OUT =INkillgen

with a twist!

(94)

Flow Function: x = y

Maygen = {x →p|yp∈MayIN} Maykill = [

p∈Vars

{x →p}

(95)

Flow Function: x = y

Maygen = {x →p|yp∈MayIN} Maykill = [

p∈Vars

{x →p}

Mustgen = {x →p|yp∈MustIN} Mustkill = [

p∈Vars

{x →p}

(96)

Flow Function: x = &y

Maygen = {x →y} Maykill = [

p∈Vars

{x →p}

(97)

Flow Function: x = &y

Maygen = {x →y} Maykill = [

p∈Vars

{x →p}

Mustgen = {x →y}

Mustkill = [

p∈Vars

{x →p}

(98)

Flow Function: x = *y

Maygen = {x →p|yp ∈MayIN andpp∈MayIN} Maykill = [

p∈Vars

{x →p}

(99)

Flow Function: x = *y

Maygen = {x →p|yp ∈MayIN andpp∈MayIN} Maykill = [

p∈Vars

{x →p}

Maygen = {x →p|yp∈MustIN andpptin}

Maykill = [

p∈Vars

{x →p}

(100)

Flow Function: *x = y

Maygen = {p→p |xp∈MayIN,yp∈MayIN} Maykill = [

p∈Vars

{p→p |xp ∈MustIN}

(101)

Flow Function: *x = y

Maygen = {p→p |xp∈MayIN,yp∈MayIN} Maykill = [

p∈Vars

{p→p |xp ∈MustIN}

Mustgen = {p→p |xp∈MustIN,yp ∈MustIN} Mustkill = [

p∈Vars

{p→p |xp∈MayIN}

(102)

Flow Function: *x = y

Maygen = {p→p |xp∈MayIN,yp ∈MayIN} Maykill = [

p∈Vars

{p→p|xp∈MustIN} Strong update!!

Mustgen = {p→p |xp∈MustIN,yp ∈MustIN} Mustkill = [

p∈Vars

{p→p |xp∈MayIN} Weak update!!

(103)

Summarizing Flow Functions

May Points-To analysis

(104)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

(105)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

(106)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

should kill using Must Points-To information

(107)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

should kill using Must Points-To information Must Points-To analysis

(108)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

should kill using Must Points-To information Must Points-To analysis

A points-to pair should be removed if it can be removed along some path

(109)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

should kill using Must Points-To information Must Points-To analysis

A points-to pair should be removed if it can be removed along some path

should remove all weak updates

(110)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

should kill using Must Points-To information Must Points-To analysis

A points-to pair should be removed if it can be removed along some path

should remove all weak updates

should kill using May Points-To information

(111)

Summarizing Flow Functions

May Points-To analysis

A points-to pair should be removed only if it must be removed along all paths

should remove only strong updates

should kill using Must Points-To information Must Points-To analysis

A points-to pair should be removed if it can be removed along some path

should remove all weak updates

should kill using May Points-To information Must Points-To⊆May Points-To

(112)

Safe Approximations for May and Must Points-to

A pointer variable

May Must

Points-to points to every possible location

points to nothing Alias aliased to every other

pointer variable

only to itself

(113)

Non-Distributivity of Points-to Analysis

May Information Must Information 1

2 x = &z 3y = &w

4 ∗x =y

1 x =a;

2 b= &c

c = &d 3 b = &e e= &d

4 a=∗b

(114)

Non-Distributivity of Points-to Analysis

May Information Must Information 1

2 x = &z 3y = &w

4 ∗x =y

1 x =a;

2 b= &c

c = &d 3 b = &e e= &d

4 a=∗b zw is spurious

(115)

Non-Distributivity of Points-to Analysis

May Information Must Information 1

2 x = &z 3y = &w

4 ∗x =y

1 x =a;

2 b= &c

c = &d 3 b = &e e= &d

4 a=∗b zw is spurious ad is missing

References

Related documents

The lack of surface information in point models creates difficulties in operations like generating global illumination effects and computing point-pair visibility

• Our analysis concludes that d is live at the entry of b2.. information is computed for every control flow points). • Our analysis concludes that d is live at the entry

{p ∨ q, ¬¬q, r } ` ¬¬q Monotonic applied to 1 We need to point at an earlier statement. Since assumption does not depend on any other statement, no need

• in defining other strongly live variables in an assignment statement (this case is different from simple liveness analysis)... Using Data Flow Information of Live

Using Data Flow Information of Live Variables Analysis.. • Used for

Helpdesk management system is a process of handling helpdesk tickets, incidents and service requests and timely resolution. Network operator shall prepare a Change

Helpdesk management system is a process of handling helpdesk tickets, incidents and service requests and timely resolution. Network operator shall prepare a Change

Helpdesk management system is a process of handling helpdesk tickets, incidents and service requests and timely resolution. Network operator shall prepare a Change