After six months of fractious debate (and an almost fatal vote), senators will vote tonight on the government's landmark cannabis legislation — a bill that has been picked apart by senators determined to rework major sections of the Liberals' plan to end the prohibition on recreational pot use.

Senators of all political stripes have passed an eye-popping 45 amendments — an unusually large number of changes for a piece of government legislation.

Even with those Senate changes, there is no guarantee the bill will pass through the upper house tonight.

Government sources, speaking on background to CBC News, said a final count is still uncertain. Some Indigenous senators have raised serious concerns about the the legislation; they maintain consultations with First Nations, Metis and Inuit were woefully inadequate.

They could still vote as a bloc against the bill, depriving the government of eight crucial votes needed to overcome entrenched opposition from the 32 sitting Conservative senators.

There are 43 Independent senators — most of them appointed by Trudeau — 12 Liberal senators and seven non-affiliated senators.

A last-minute letter, written by Indigenous Services Minister Jane Philpott and Health Minister Ginette Petitpas-Taylor and delivered to Indigenous senators Wednesday, sought to assure them that the government is committed to addressing their concerns. That letter seems to have allayed some of the initial concerns; Indigenous senators opted not to make further changes to the bill Wednesday evening.

Indigenous leaders have been pushing for excise tax powers, a public health campaign to educate Indigenous youth about the potential dangers of cannabis, and a one-year delay in implementation.

If it's passed tonight at the third reading vote, the amended bill will head back to the House of Commons for final approval. It's likely the Liberal-dominated House will reject at least some of the Senate-approved amendments, leading to a possible standoff between the two houses of Parliament.

"We're confident with Bill C-45. However, we recognize that the Senate has done some work and I'm looking forward to seeing the recommendations that they bring forward," Petitpas Taylor told reporters Wednesday.

"[After the vote] we'll be able to evaluate what the results are and from there ... we'll be able to make a determination as to what our next steps are going to be moving forward."

As currently written, the bill stipulates the law does not come into force until a date fixed by an order of the governor-in-council — Prime Minister Justin Trudeau's cabinet — meaning legalization is not automatic after the law passes.

Full legalization is not expected until August at the earliest, as provinces have said they will need eight to 12 weeks of prep work before they can start selling the product to consumers.

12 consequential amendments

While many of the Senate amendments are simply language tweaks, at least 12 make consequential amendments to the proposed legal framework.

The Senate's social affairs committee passed an amendment that would leave rules on home cultivation up to the provinces and even allow them to prohibit the practice altogether. That would mean Quebec and Manitoba — two provinces that have already said they want to ban home cultivation — would be able to do so.

Trudeau has thrown cold water on such a move, saying home cultivation is a key component of his government's push to dismantle the black market.

"The decision on home cultivation of up to four plants was based on logic and evidence and it's one that we will continue to establish as part of the federal framework," he said.

Independent Ontario Sen. Ratna Omidvar secured enough support for an amendment that would protect immigrants or refugees convicted of relatively minor cannabis-related offences from being barred from getting their citizenships, or from deportation.

The government will consider that amendment if the bill passes tomorrow, sources said.

Another amendment, from Conservative Quebec Sen. Claude Carignan, would establish a public registry of cannabis industry investors and directors in an effort to keep organized crime out of legal entities. Liberal Quebec Sen. Serge Joyal passionately supported such a move, saying many medical marijuana companies already have been infiltrated by criminal elements through offshore entities.

Under that amendment, a cannabis company's directors, officers, controlling parent corporations or trusts, and their directors, members and shareholders, would be listed in a public registry.

Critics of this change — which some Independent senators maintain was dumped on the Red Chamber without much advance notice or debate — say it raises serious privacy concerns. This sort of reporting does not exist for other publicly traded companies.

'Social sharing'

Another major amendment, this time from Independent Nova Scotia Sen. Wanda Bernard, would allow for so-called "social sharing" of cannabis so that teens two years apart in age — and/or parents of minors — could share cannabis without breaking the law. This mimics the legal framework for alcohol, which does not criminalize parents for sharing liquor with their children.

Conservative Manitoba Sen. Don Plett, however, has introduced a sub-amendment that would maintain parental sharing while imposing criminal sanctions for other forms of sharing, including socially-sharing with a minor who is close in age.

In the original version of the bill, minors would be able to hold up to five grams of pot so that young people can avoid criminal records for simple possession. The bill includes stiff criminal penalties for adults selling or sharing cannabis with anyone under the legal age.

Other amendments include a ban on certain promotional activities and some legal protections for police who seize cannabis plants from a residence.