A person acquitted upon the facts and merits on a former trial, may plead such acquittal in bar of a second prosecution for the same offense, notwithstanding any defect in the form or substance of the indictment or accusation on which he was acquitted, unless the case be for a violation of the law relating to the state revenue and the acquittal be reversed on a writ of error on behalf of the Commonwealth.
Va. Code § 19.2-292