Hi, On Thu, 11 Apr 2019, Duy Nguyen wrote: > On Thu, Apr 11, 2019 at 3:56 AM Johannes Schindelin > <Johannes.Schindelin@xxxxxx> wrote: > > > @@ > > > + expression c; > > > ++expression r; > > > + expression s; > > > + @@ > > > +-- get_commit_tree(c) = s > > > ++- repo_get_commit_tree(r, c) = s > > > + + c->maybe_tree = s > > > > I think this is wrong, and admittedly I had the very same version > > originally. > > > > When you have an arbitrary `r` in any `repo_get_commit_tree(r, c)` (as > > opposed to `the_repository`), the conversion to `c->maybe_tree` is most > > likely incorrect. > > I did read the get_commit_tree() source code before doing this. struct > repository is only used to get commit graph to speed things up and we > can't change a thing there when maybe_tree is reassigned. To reassign > maybe_tree, commit-graph does not matter. Neither does the_repository > (vs arbitrary struct repo) You read the current code. Obviously, you had no future code to read. The cocci patch you are changing will affect future code, too. The safe, and correct, thing to do, then, is to not pretend to know what future `get_commit_tree()` functions will do, and instead go with the stricter version of the cocci patch, as I had suggested. Ciao, Johannes > > > > Therefore, I don't think that we can do that. > > > > Ciao, > > Johannes > > > > -- > Duy >