Petitioner sued in habeas corpus alleging that he had been tried on an information charging a felony; that he had entered a plea of “not guilty” and one of “not guilty by reason of insanity” under the provisions of sections 1026 and 1026a of the Penal Code; that both trials were had before the same jury, and that he was found guilty of the crime charged and also was found to have been sane when the crime was committed. He seeks his release from the state penitentiary on the ground that these sections of the Penal Code are unconstitutional.
His first point is that the amendment to section 7 of article I of the state Constitution, which was adopted at the general election in 1928, and which permits a defendant in a felony case to waive a jury trial, renders these code sections inoperative, as they cover proceedings in a trial by jury only. The section of the Constitution, as amended in 1928, reads in part as follows: “The right of trial by jury shall be secured to all, and remain inviolate. ... A trial by jury may be waived in all criminal cases, by the consent of both parties, expressed in open court by the defendant and his counsel, and in civil actions. ...” Section 1026 of the Penal Code, which covers the procedure when a plea of “not guilty by reason of insanity” is entered, was enacted by the legislature in 1927 along with an amendment to section. 1016 which specially authorizes such a plea. Among other things section 1026 provides that when this *543plea is entered along with another plea and the jury finds the defendant guilty, “then the question whether the defendant was sane or insane at the time the offense was committed shall be promptly tried, either before the same or before a new jury, in the discretion of the court”.
The argument is that as there is no provision for a trial of this issue before a court when a jury has been waived the entire section must fall.
There are two answers to the argument. First, the Constitution secures to every defendant charged with a felony the right to a jury trial where that right was recognized in the common law. The amendment merely permits him to waive a jury under certain circumstances. Hence when a jury is not waived the provisions of section 1026 are necessary to prescribe the procedure to be followed in such cases. The section is therefore “constitutional” legislation so far as it goes and is applicable to all eases where a jury is not waived. Second, though there is no express statutory procedure prescribed for a case where a jury is waived, when a defendant who has entered the two pleas voluntarily waives his constitutional right to a trial by jury he must be deemed to have consented to a trial of these issues before the court sitting without a jury. In such event the provisions of section 187 of the Code of Civil Procedure become applicable— that “where jurisdiction is . . . conferred on a court or judicial officer, all the means necessary to carry it into effect are also given”. The principle involved is this—a statute may not be held unconstitutional unless it offends some constitutional principle. Thus, we may not hold a statute unconstitutional merely because it does not cover every emergency which may arise. Here the petitioner was tried before a jury on both pleas and the statute under attack prescribed a fair mode of procedure for such trials. If a ease should arise where one charged with a felony should waive a jury and he should then claim that the statutory procedure was incomplete we would want him to show us wherein his constitutional rights have been denied.
We should not, however, be understood as holding that a defendant who has entered both pleas may not waive a jury trial on his plea of not guilty, and demand a trial by jury on his plea of insanity. The point is not before us *544and we express no opinion. It is sufficient to say that, if this may be done, section 1026 provides the “means necessary” for such a trial within the contemplation of section 187 of the Code of Civil Procedure.
The second point raised by petitioner is that there is a denial of equal protection of the law in section 1026 when read in connection with section 1026a, which provides that when a person has been found “not guilty by reason of insanity” and committed to a state hospital he may not seek his release until a year has elapsed since his confinement. The argument seems to be that equal protection is thus denied because in some cases the district attorney might elect not to prosecute the individual for the crime charged but, instead, might institute insanity proceedings, and that, if the latter course were followed and the individual committed to a state hospital, then he might seek his release at any time. The point is without merit. The code sections prescribe the procedure to be followed in a certain well-defined class of cases (those who are charged with a felony and who enter the two pleas), and the sections apply to all persons who come within that class. The classification of these individuals is neither arbitrary nor unreasonable and does not offend any of the petitioner’s constitutional rights.
The petition is dismissed and the prisoner remanded.
Sturtevant, J., and Spence, J., concurred.