An asymptotic-giant-branch star in the progenitor system of a type Ia supernova