https://cambium.inria.fr/~maranget/MPRI/03.pdf, slides 7 and 16–18.