No witness called by the attorney for the Commonwealth, or by the court, and required to give evidence for the prosecution in a proceeding under this article shall ever be proceeded against for the offense concerning which he testified. Such witness shall be compelled to testify and may be punished for contempt for refusing to do so.
Va. Code § 18.2-437