If after making his will the testator makes a contract for the sale or transfer of real or personal property specifically bequeathed therein and the whole or any part of the contract remains executory at his death, the disposition of the property by the contract does not revoke the bequest but the property passes to the legatee subject to the contract.
755 ILCS 5/4-8