If, during the trial, the court is of the opinion that the facts charged in the indictment do not constitute an offense punishable by law, it shall order the jury to be discharged and the indictment to be quashed, and thereupon take the proceedings directed in § 16-89-113(b).