Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builtin: avoid passing bad parent argument to op_sibling_splice
op_sibling_splice() is supposed to be called with a parent/child op pair as the first two arguments. But in `op_sibling_splice(parent, pushop, 1, NULL)`, `parent` is not necessarily a parent of `pushop`; it can also be a grandparent. In practice, this is harmless, however, as the parent argument is only used when splicing the first or last sibling of an op chain, which is never the case here (as ensured by the `argop` checks). So just avoid `parent` altogether and pass `NULL` as the first argument instead, which is a documented part of the op_sibling_splice() API (and will raise a proper error if our assumptions don't hold in the future).
- Loading branch information