Applies the modifications of this update to ctx.
Throws an exception if the modifications are invalid (for example if we would redefine a constant).