Skip to content

How to connect two alias dataflow node in Go? #17329

Answered by rvermeulen
Lslightly asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Lslightly,

Thanks for your question.

In the first scenario you should be able to connect s with s[0] and s[1:] through an SSAVariable and its uses.

For example,

predicate relatedBy(SsaVariable v, Name n, Name m) {
    n != m and
    v.getAUse().isFirstNodeOf(n) and v.getAUse().isFirstNodeOf(m)
}

The second example is much more complicated because you need to keep track of aliases and match access path to relate access paths.

For example, to relate x.g and b.f.g you can relate x with b through b.f and later match x.g with b.f.g through substitution of x in the access path with the access path b.f.

An overfitted, but possible useful starting point, example is:

predicate isAliasedThroug…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Lslightly
Comment options

@Lslightly
Comment options

@smowton
Comment options

@Lslightly
Comment options

@smowton
Comment options

Answer selected by Lslightly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants