If before the convention, see Chicago, 1968. Robert Kennedy was assassinated after securing the nomination, before the convention. An open convention nominated Hubert H. Humphrey. If after the convention, the party's national committee would have to decide who then became the nominee. I doubt either party would automatically give the nomination to the VP candidate, since the VP is often selected to avoid overshadowing the presidential nominee. Could you see the Republicans in 1988 turning to Dan Quayle for the general election?
edit: sp