;; Function bar (bar) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING p = NONLOCAL p.1_1 = p derefaddrtmp = &NONLOCAL *p.1_1 = derefaddrtmp 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 p STOREDANYTHING = { } INTEGER = { ANYTHING } p.1_1 = { ESCAPED NONLOCAL } same as p p = { ESCAPED NONLOCAL } derefaddrtmp = { NONLOCAL } Alias information for bar Aliased symbols .MEM, UID D.1216, void, is global, default def: .MEM_2(D) p, UID D.1206, int *, is addressable, is global Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information p.1_1, points-to non-local, points-to escaped, points-to vars: { } bar () { int * p.1; : p.1_1 = p; *p.1_1 = 1; return; } ;; Function foo (foo) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING addr = &NONLOCAL q_2 = addr derefaddrtmp = &i *q_2 = derefaddrtmp i = &NULL D.1212_3 = i ESCAPED = D.1212_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 i } NONLOCAL = { ESCAPED NONLOCAL } STOREDANYTHING = { } INTEGER = { ANYTHING } addr = { NONLOCAL } q_2 = { NONLOCAL } same as addr i = { NULL ESCAPED NONLOCAL } same as D.1212_3 derefaddrtmp = { i } D.1212_3 = { NULL ESCAPED NONLOCAL } Alias information for foo Aliased symbols .MEM, UID D.1211, void, is global, default def: .MEM_4(D) i, UID D.1213, int, is addressable Call clobber information ESCAPED, points-to non-local, points-to NULL, points-to vars: { i } Flow-insensitive points-to information q_2, points-to non-local, points-to vars: { } foo (long unsigned int addr) { int * * q; int i; int D.1212; : q_2 = (int * *) addr_1(D); *q_2 = &i; i = 0; bar (); D.1212_3 = i; return D.1212_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 p = NONLOCAL p.0_1 = &p ESCAPED = p.0_1 D.1210_2 = 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 ESCAPED NONLOCAL p } NONLOCAL = { ESCAPED NONLOCAL } same as D.1210_2 STOREDANYTHING = { } INTEGER = { ANYTHING } p.0_1 = { p } p = { ESCAPED NONLOCAL } D.1210_2 = { ESCAPED NONLOCAL } Alias information for main Aliased symbols p, UID D.1206, int *, is addressable, is global .MEM, UID D.1208, void, is global, default def: .MEM_3(D) Call clobber information ESCAPED, points-to non-local, points-to NULL, points-to vars: { p } (includes global vars) Flow-insensitive points-to information main () { int D.1210; long unsigned int p.0; : p.0_1 = (long unsigned int) &p; D.1210_2 = foo (p.0_1); if (D.1210_2 != 1) goto ; else goto ; : abort (); : return 0; }