Skip to content

Ruby: Fix basicStoreStep#7059

Merged
hvitved merged 3 commits intogithub:mainfrom
hvitved:ruby/basic-store-step-postupdate
Nov 9, 2021
Merged

Ruby: Fix basicStoreStep#7059
hvitved merged 3 commits intogithub:mainfrom
hvitved:ruby/basic-store-step-postupdate

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Nov 4, 2021

Consider this snippet:

class Container
    def field=(val)
        puts self.field
        @field = val
    end

    def field
        @field
    end
end

def m()
    var = Container.new
    var.field = "hello"
    puts var.field
end

With the existing formulation of basicStoreStep, we would track flow from "hello" into self.field in the setter, because the target of the store was the pre-update node and not the post-update node. However, we actually didn't have any flow, since basicStoreStep was erroneously restricted to target only local source nodes. The second commit introduces the false flow (and the correct missing flow) by removing the local-source-node restriction, and the last commit removes the false flow by targeting post-update nodes.

@tausbn : AFAICT, the Python implementation also doesn't use post-update nodes, but perhaps there it is not a problem, if the pre-update node may not flow into a call like above.

@hvitved hvitved requested a review from a team as a code owner November 4, 2021 13:29
@github-actions github-actions bot added the Ruby label Nov 4, 2021
@tausbn
Copy link
Contributor

tausbn commented Nov 4, 2021

Thanks for the ping! I think @yoff may be better situated to weigh in on the Python side of things. (If not, I'll do my own investigations when time permits.)

Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@hvitved hvitved merged commit 8195ebf into github:main Nov 9, 2021
@hvitved hvitved deleted the ruby/basic-store-step-postupdate branch November 9, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants