On 27 February 2017 at 08:41, <domi...@honnef.co> wrote:

> Let's say I have the following function:
>
> func main():
> 0:                                                                entry
> P:0 S:0
> t0 = *os.Stdout                                                *os.File
> t1 = make io.Writer <- *os.File (t0)                          io.Writer
> t2 = io.WriteString(t1, "":string)                   (n int, err error)
> return
>
> and I want to query the second return value of io.WriteString. How would I
> get a suitable ssa.Value to add to pointer.Config.Queries? Note that there
> is no extract t2 #1 in the program, because the return values were
> discarded.
>
> I could add the missing extract call to the program myself (I use my own
> fork of go/ssa <https://goto.google.com/ssa> with some internals
> exposed), but I'd much prefer not having to do that, as it would affect
> other parts of the analysis.
>

The current go/pointer API doesn't allow you to do it, but conceptually the
missing parts are the analogues of what AddIndirectQuery does for pointer
types but applied to all other kinds of type: tuple, struct, tuple,
channel, and so on.  You may also need to extend the Pointer and
PointsToSet portions of the API to allow inspection of points-to results
for arbitrary values that are not themselves pointers but contain pointers,
analogous to what PointsToSet.DynamicTypes does for interfaces and
reflect.Values.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to