Upon an appeal by the state from any order the supreme court may affirm or reverse such order. Upon an appeal from a sentence on the ground that it is illegal the court shall either approve such sentence or if it decides that the sentence is illegal shall correct the sentence to correspond to the verdict. The sentence as approved or corrected shall be enforced by the court from which the appeal was taken.
A.R.S. § 13-4038