Skip to content

[Go] Getting the resolved type of an argument #15591

Answered by smowton
rh-tguittet asked this question in Q&A
Discussion options

You must be logged in to vote

I suspect this might have to do with the K8sControllerClient module that you're importing-- I can't tell for sure without its source code, but does it perhaps introduce models that would propagate dataflow between the different arguments of that Get call?

Meanwhile, to do what you want I suspect you don't need dataflow at all. In your first argument you use arg.getOperand().getType(), which assumes the argument is an address-of operator. Why not drop that assumption and instead use arg.getType().(PointerType).getBaseType() to account for more kinds of expression?

If your concern is that you might have something like Get(..., GetResource()) where GetResource has a loose return type and you…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@rh-tguittet
Comment options

@smowton
Comment options

@smowton
Comment options

@smowton
Comment options

@rh-tguittet
Comment options

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