The Fairfax City Council passed legislation in an emergency session Monday night to eliminate a loophole in its city code that allowed three people to escape prosecution for drunk driving and that some officials feared could invalidate 500 previous drunk driving convictions in the city.

Three Fairfax City drunk-driving cases were dismissed in Fairfax District Court last week because of some apparently unconstitutional phrase in the five-year-old code.

All pending drunk-driving cases are being changed from city to state charges, City Attorney William Roeder said yesterday, and the new language passed by the City Council Monday should eliminate the loophole under which a 46-year-old Fairfax County woman, a 21-year-old Manassas man and a 20-year-old California man escaped prosecution.

While more than 500 previous drunk-driving convictions in the city in the last year might also appear to be invalid under the court decisions, Roeder said he doubted many motorists would try to appeal because of the high court costs and because, he said, it was unlikely the Virginia Supreme Court would uphold the lower court decisions.

City police arrest 50 persons a month on drunk-driving charges, most under the city code rather than the state code, because the city then gets part of the fines. Under new legislation passed by the Virginia General Assembly last year, motorists convicted of drunk driving under local or state laws can be fined up to $1,000 and jailed for up to a year.

The language in the 1978 Fairfax City code that was ruled unconstitutional by Fairfax District Court Judges G. William Hammer and Robert T.S. Colby was the phrase "as amended in the future." The city tacked on the phrase when it adopted motor vehicle laws under the state code in an attempt to avoid constant amendments to the city code every time the state code was amended.

However, defense attorney George Freeman, who said he won a similar case recently in Culpeper, Va., pointed out the questionable language to Judge Hammer last Tuesday when his client was charged with drunk driving.

"A lot of small towns put in language like this so they wouldn't have to fool with future amendments," said Freeman yesterday. "But local jurisdictions can't adopt future laws," they can only adopt existing state laws, he said.

A number of state motor vehicle laws, besides the drunk-driving laws, have been amended since 1978 when Fairfax City put in its "as amended in the future," said Roeder, and thus could also have been affected by last week's court rulings. The council amendment eliminates the phrase from the city code as it affects all traffic laws.

Roeder said after Freeman won his case before Judge Hammer, the city decided to amend the code "when the council returned in September. . . . But word gets around quickly" among defense lawyers and when two more drunk driving cases were thrown out on Thursday the city decided it had to act fast, said Roeder.