A. An illegal sentence may be corrected at any time by the court that imposed the sentence or by an appellate court on review.
B. A sentence may be reviewed as to its legality on the application of the defendant or of the state:
(1) In an appealable case by appeal; or
(2) In an unappealable case by writs of certiorari and prohibition.
C. Nothing in this Article shall be construed to deprive any defendant of his right, in a proper case, to the writ of habeas corpus.
Amended by Acts 1984, No. 587, §1.