No law specifically protects a police officer from the death penalty. In the U.S. the death penalty can be imposed only for killing another person (or for treason), and only by federal and military courts and courts in 28 states. Governors in three other states have imposed moratoriums on the death penalty. The other 22 states have abolished it.
A Virginia police officer, Frank J. Coppola, was convicted of the robbery and murder of Muriel Hatchell and sentenced to death in 1978. He was executed in 1982.