Yes... because somehow a dead person can be prosocuted.
Is it no longer illegal? Here is the US, you can be prosecuted for an attempted suicide. There are some legitimate reasons for this, mostly revolving around the fact that it leads to court ordered therapy for the person.
Better hope you don't fail then because if you thought your life sucked before...