A person who repents of shirk and embraces Islam necessarily falls under the same ruling as someone who dies in shirk.Forgiveness of Shirk and Other Sins; Threats and Divine Mercy