312. Whoever voluntarily causes a woman with child to miscarry shall be punished with imprisonment for a term which may extend to three years or with fine or with both; and if the woman is quick with child, shall be punished with imprisonment for a term which may extend to seven years, and shall also be liable to fine.

Explanation—A woman who causes herself to miscarry is within the meaning of this section.

Exception—This section does not extend to a medical practitioner registered under the Medical Act 1971 [Act 50] who terminates the pregnancy of a woman if such medical practitioner is of the opinion, formed in good faith, that the continuance of the pregnancy would involve risk to the life of the pregnant woman, or injury to the mental or physical health of the pregnant woman, greater than if the pregnancy were terminated.