If a marriage is determined to be void, an agreement that would otherwise have been a premarital agreement is enforceable only to the extent necessary to avoid an inequitable result.