“[Yunsong] Zhao was arrested because he allegedly attached a 30-round magazine to a rifle,” richmond.com reports. “He was allowed to own both the gun and magazine, but when they were combined, the rifle qualified as an assault weapon prohibited to people with Zhao’s visa status.” Yes, you read that right . . .

You can have as many 30-round rifle, handgun or shotgun ammunition magazines as you like in Virginia — as long as you don’t pop one into a gun.

Zhao’s defense attorney isn’t challenging the box of rocks stupid mag law. As Jason Wolfrey asked the court to allow bail for his client (denied), he told the court that Zhao never used his rifle with the 30-round magazine.

Zhao did own two 30-round magazines, but he traded them for a sling for his firearm, Wolfrey said. When Zhao checked out his gun from the student gun lockers at the Virginia Tech Police Department and went to a firing range in the national forest with a friend, he had a legal 20-round magazine, Wolfrey said. Wolfrey offered pictures of the gun with a 20-round magazine, saying this was what Zhao had used. A video from the firing range that shows the smaller magazine may eventually be offered as evidence as well, Wolfrey said. Little replied that the Blacksburg police detective who watched the student at the firing range was positive that he had seen a 30-round magazine on the rifle.

Virginia Tech kicked Zhao out after the weapons charge, and added a bit about his failure to maintain a sufficient grade point average. Which invalidates his student visa.

Hence the bail denial. The great state of Virginia worries that the feds will scoop up the Chinese ex-student and send him home before they can make an example of him, both as a 30-round mag scofflaw and a gun nut.

A characterization that doesn’t make Mr. Zhao’s lawyer happy.

[Commonwealth’s Attorney Erin] Little said that authorities had taken a bayonet and more than 700 rounds of ammunition, along with other items, from Zhao’s dormitory room for safe-keeping, and that Zhao owned a former police car that he’d equipped with antennas and a push bar, though the latter was not actually attached to the vehicle, she said. Wolfrey responded that these items had nothing to do with the charges against Zhao and noted police had not found a 30-round magazine. Three search warrants filed in the case said that police had taken nothing from Zhao’s dorm room and two vehicles, and they made no mention of the items Little listed, Wolfrey noted. If Zhao had a high quantity of ammunition in his room, it was because he liked target shooting, Wolfrey said. “He was a regular user of the firing range. It’s not unusual for people to buy in bulk,” Wolfrey said. Zhao had followed university rules about storing firearms at the police department, Wolfrey said. “What he’s accused of comes down to whether he had a 30-round magazine or a 20-round magazine,” Wolfrey said.

How stupid is that? Especially considering . . .

Tech has issued multiple statements this week saying authorities never thought Zhao was a threat to anyone.

The same can’t be said for Virginia’s gun laws.