{"id":22044742,"url":"https://github.com/barrenszeppelin/pointer","last_synced_at":"2025-03-23T14:14:11.868Z","repository":{"id":125454181,"uuid":"533279991","full_name":"BarrensZeppelin/pointer","owner":"BarrensZeppelin","description":"Implementation of Steensgaard's pointer analysis for Go","archived":false,"fork":false,"pushed_at":"2023-08-31T20:22:59.000Z","size":64,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T20:18:28.359Z","etag":null,"topics":["call-graph-analysis","callgraph","go","golang","pointer-analysis","unification-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BarrensZeppelin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-06T10:48:11.000Z","updated_at":"2024-12-04T01:30:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"37e86e68-1a60-40ad-8198-7263a44eff2e","html_url":"https://github.com/BarrensZeppelin/pointer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarrensZeppelin%2Fpointer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarrensZeppelin%2Fpointer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarrensZeppelin%2Fpointer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarrensZeppelin%2Fpointer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BarrensZeppelin","download_url":"https://codeload.github.com/BarrensZeppelin/pointer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111947,"owners_count":20562512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["call-graph-analysis","callgraph","go","golang","pointer-analysis","unification-algorithm"],"created_at":"2024-11-30T13:07:50.501Z","updated_at":"2025-03-23T14:14:11.835Z","avatar_url":"https://github.com/BarrensZeppelin.png","language":"Go","readme":"# Unification based pointer analysis for Go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/BarrensZeppelin/pointer.svg)](https://pkg.go.dev/github.com/BarrensZeppelin/pointer)\n\nThis repository contains a Go adaptation of [Steensgaard's pointer analysis algorithm][steensgaard].\nThe result of the static analysis can be used to determine the set of objects\nthat a variable may point to at run-time. It can also be used to construct a\ncall graph where dynamically dispatched calls have been resolved using the\ncomputed points-to information.\n\n\n## Analysis details\n\nThe analysis is field-sensitive, context-insensitive, and aims to be sound.\n\nDue to field-sensitivity the analysis cannot run in $O(n\\cdot\\alpha(n))$ time (where $n$ is the size of the program), which is the runtime of the algorithm presented in the paper.\nOther details, such as handling dynamic dispatch for interface methods, also prevent us from obtaining the above runtime.\nIt should still be fast, though.\nThe goal is that this implementation should be significantly faster than the implementation of [Andersen's pointer analysis algorithm][andersen] provided by [the Go team][gopointer] (with a precision trade-off).\n\nThis implementation makes many of the same design choices as the implementation of Andersen's algorithm.\nNotably, arrays (and slices) are modelled as having 1 element, conversions using unsafe.Pointer are not modelled soundly, and the effects of opaque code (runtime, Cgo, etc.) are under-approximated.\nThe API is also similar.\n\nContrary to the implementation of Andersen's algorithm, no special modelling is offered for reflection (which is available under a flag there).\nAlso, in this implementation constraint generation is interleaved with constraint solving.\nThis makes it easy to only generate constraints for reachable code, which the Andersen implementation does not do.\n\n## Benchmarks\n\nThe [benchmark submodule](benchmark/main.go) contains some code for benchmarking the analysis against Andersen's pointer analysis on a few popular Go projects.\nIt measures analysis time, analysis precision, and a couple of call graph metrics.\n\nThe benchmarking code is not mature nor rigorous.\nOn my machine [crunch.py](benchmark/crunch.py) outputs:\n\n```\nBenchmark results for 14 modules\n\nSteensgaard stats:\n    Average analysis time:            2.22s\n    Average # of non-static edges:    65570.14\n    Average # of reachable functions: 12886.21\n\nAndersen stats:\n    Average analysis time:            14.89s\n    Average # of non-static edges:    30481.00\n    Average # of reachable functions: 13160.00\n```\n\n[andersen]: https://citeseerx.ist.psu.edu/document?repid=rep1\u0026type=pdf\u0026doi=b7efe971a34a0f2482e0b2520ffb31062dcdde62\n[gopointer]: https://pkg.go.dev/golang.org/x/tools/go/pointer\n[steensgaard]: https://dl.acm.org/doi/abs/10.1145/237721.237727\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarrenszeppelin%2Fpointer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarrenszeppelin%2Fpointer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarrenszeppelin%2Fpointer/lists"}