A crime may not be compromised or the prosecution or punishment upon a compromise dismissed or stayed except as provided by law.