Continuous-variable quantum key distribution (CV-QKD) with a real local oscillator (LO) experiences a phase attack security challenge due to the reference pulses transmitted along with quantum signals over an unsecure quantum channel. In this paper, a phase attack on reference pulses of CV-QKD with a real LO is investigated. The performance of the discrete-modulated (DM) CV-QKD under this attack is analyzed analytically and by simulation, and compared with the Gaussian-modulated (GM) CV-QKD. It is found that such an attack by an eavesdropper's, significantly reduce the transmission distance for the GM based CV-QKD, whereas, the DM based CV-QKD shows a high tolerance to high phase noise. Based on phase attack monitoring, a new adaptive modulation scheme is proposed for CV-QKD to adaptively switch between GM and DM so as to maintain the optimum secret key rate.