;; Function foo (foo) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING p = &NONLOCAL i = NONLOCAL vol.1_1 = i ESCAPED = p Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL } NONLOCAL = { ESCAPED NONLOCAL } same as i STOREDANYTHING = { } INTEGER = { ANYTHING } p = { NONLOCAL } vol.1_1 = { ESCAPED NONLOCAL } same as i i = { ESCAPED NONLOCAL } Alias information for foo Aliased symbols .MEM, UID D.1209, void, is global, default def: .MEM_3(D) i, UID D.1207, volatile int, is global, is volatile Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information p_2(D), points-to non-local, points-to vars: { } foo (int * * p) { int vol.1; : vol.1_1 ={v} i; return p_2(D); } ;; Function bar (bar) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING i = &NULL j = &NONLOCAL p = &i CALLUSED = *CALLUSED CALLUSED = CALLUSED + UNKNOWN CALLUSED = &p q_1 = CALLUSED q_1 = NONLOCAL derefaddrtmp = &j *q_1 = derefaddrtmp p.0_2 = p D.1213_3 = *p.0_2 ESCAPED = D.1213_3 Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { NULL ESCAPED NONLOCAL j } NONLOCAL = { ESCAPED NONLOCAL } STOREDANYTHING = { } INTEGER = { ANYTHING } i = { NULL j } j = { ESCAPED NONLOCAL j } p = { i j } same as p.0_2 CALLUSED = { NULL ESCAPED NONLOCAL i j p } CALLCLOBBERED = { } q_1 = { NULL ESCAPED NONLOCAL i j p } derefaddrtmp = { j } p.0_2 = { i j } D.1213_3 = { NULL ESCAPED NONLOCAL j } Alias information for bar Aliased symbols .MEM, UID D.1212, void, is global, default def: .MEM_4(D) i, UID D.1215, int, is addressable j, UID D.1216, int, is addressable p, UID D.1217, int *, is addressable Call clobber information ESCAPED, points-to non-local, points-to NULL, points-to vars: { j } Flow-insensitive points-to information q_1, points-to non-local, points-to escaped, points-to NULL, points-to vars: { i j p } p.0_2, points-to vars: { i j } bar () { int * * q; int * p; int j; int i; int * p.0; int D.1213; : i = 0; j = 1; p = &i; q_1 = foo (&p); *q_1 = &j; p.0_2 = p; D.1213_3 = *p.0_2; return D.1213_3; } ;; Function main (main) (executed once) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING D.1220_1 = NONLOCAL ESCAPED = &NULL Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { NULL } NONLOCAL = { ESCAPED NONLOCAL } same as D.1220_1 STOREDANYTHING = { } INTEGER = { ANYTHING } D.1220_1 = { ESCAPED NONLOCAL } Alias information for main Aliased symbols .MEM, UID D.1219, void, is global, default def: .MEM_2(D) Call clobber information ESCAPED, points-to NULL, points-to vars: { } Flow-insensitive points-to information main () { int D.1220; : D.1220_1 = bar (); if (D.1220_1 != 1) goto ; else goto ; : abort (); : return 0; }