function luaK.patchlistaux(q,k,h,M,c,Z)while h~=q.NO_JUMP do local Q=q:getjump(k,h)if q:patchtestreg(k,h,c)then q:fixjump(k,h,M)else q:fixjump(k,h,Z)end h=Q end end

function luaK:patchlistaux(fs, list, vtarget, reg, dtarget)
  while list ~= self.NO_JUMP do
    local _next = self:getjump(fs, list)
    if self:patchtestreg(fs, list, reg) then
      self:fixjump(fs, list, vtarget)
    else
      self:fixjump(fs, list, dtarget)  -- jump to default target
    end
    list = _next
  end
end
