To his credit, Ryan Toyota hammered out his Saturday night plan while he was still sober. Knowing full well he was going to down some drinks at a bar district in Burlington, Ont., the 28-year-old arranged to crash at a friend’s house, then drive home to nearby Oakville the next morning—after his buzz wore off. If only every drinker was so responsible.

His well-laid plan didn’t quite pan out. The friend felt sick and left the restaurant early, and by the time Toyota took a taxi back to the house in the wee hours of Sunday morning (Feb. 8, 2015), his host was conked out on the couch, too inebriated to hear the knocking at the door. Locked outside, the temperature well below zero, Toyota retreated to the only place he could think of: his white SUV, parked nearby.

He turned on the ignition, cranked up the heat, and fell asleep.

At 5:00 a.m., a by-law officer noticed the running car and phoned 911. After a Breathalyzer test showed he had 160 mg of alcohol per 100 mL of blood—twice the legal limit—Toyota was promptly charged with “care or control” of a vehicle while impaired.

Drunk parking, in other words.

Although it may seem ludicrous at first glance, the case is certainly not the first of its kind to come before the courts. For decades, judges across the country have wrestled with what it means for an impaired individual to have “care or control” of a vehicle when they aren’t technically driving—and although the country’s top court issued a recent ruling that provided much-needed clarity, many motorists remain oblivious to the law. “People don’t know you could actually not be driving—you could be sleeping in your car, or even sitting and waiting for a tow truck—and still be charged and convicted,” says Jonathan Lapid, a veteran Toronto lawyer who has defended impaired-driving suspects for 25 years.

The “care or control” provisions of the Criminal Code acknowledge what few Canadians would dispute: that booze and cars should never mix, regardless of whether the car happens to be parked. Even if a drunk person insists he isn’t planning to drive, for example, what stops him from suddenly changing his mind? (Or accidentally nudging the gearshift into reverse, endangering innocent lives?) As the Supreme Court ruled way back in 1967, Parliament’s goal was “to strike at the very root of the evil, to wit: the combination of alcohol and automobile that normally breeds this element of danger.”

But does that element of danger truly exist in every instance? Or should prosecutors have to prove that a suspect’s specific conduct was indeed risky in order to secure a “care or control” conviction? In recent years, five provincial appeal courts agreed with the latter. In 2012, the Supreme Court went one step further, ruling that the Crown must prove a “realistic risk” of danger, not merely a “theoretical” risk. (In that case, the high court upheld the acquittal of a Quebec man, Donald Boudreault, who was charged with impaired driving after passing out in his pickup truck while waiting for a cab to take him home. “Use of the vehicle for a manifestly innocent purpose should not attract the stigma of a criminal conviction,” the majority ruled, in a 6-1 decision.)

To be clear, the high court did not decree that all impaired-parking suspects should be acquitted from this point forward (or that cops should stop arresting them altogether). To the contrary, the ruling reaffirms that “anyone found inebriated and behind the wheel with a present ability to drive will—and should—almost invariably be convicted.” However, the law must also be flexible enough to separate the vast majority of accused drunk drivers from someone like Ryan Toyota, a credible witness who took all the appropriate steps to avoid the very crime he was charged with—and who, despite a wrinkle in his plan, still posed no realistic risk to the public.

“Mr. Toyota had no intention of driving his vehicle home that night,” Justice Alan D. Cooper ruled on March 1. “The clear plan was for the defendant to spend the night inside that residence so he would not have to drive home.” As for the argument he may have changed his mind at any moment and steered away, Cooper didn’t buy it. He also found it “unlikely” that Toyota “would have unintentionally set his vehicle in motion in his intoxicated condition” because “he would have had to put his foot on the brake, push a button, and pull the gear lever back.” (His lawyer, Frank Genesee, did not respond to an interview request from Maclean’s. Among the few questions not answered in the ruling is whether Toyota’s SUV was a Toyota model.)

Impaired-driving experts say the judgment reinforces the importance of assessing each case on its own merits. “If there is strong evidence that a guy is sleeping it off in his car, and it can be established that there is no realistic risk of putting the vehicle in motion, I’m not terribly concerned,” says Robert Solomon, a Western University law professor and director of legal policy at Mothers Against Drunk Driving (MADD) Canada. “We are concerned about people who pose a risk, and in this case, there seems to be lots of evidence that this guy’s story was true.”

If nothing else, Lapid says, the ruling offers a good opportunity to repeat the advice he so often provides to his clients. “Don’t use your car as a shelter,” he says. “It’s not a good safe haven because you are going to have an uphill battle trying to prove to the courts that you wouldn’t have put the vehicle in motion.”

Consider getting a copy of your friend’s house key instead.