摘要 |
<p>A method and an apparatus for preventing register conflict, wherein the method comprises: obtaining a life cycle of each variable of a program in a register; and detecting whether the life cycle of the each variable in the register overlaps another, and reporting an alarm if a detection result is yes. The apparatus comprises: an obtaining module, a detection module and an alarm module. The obtaining module is configured to obtain the life cycle of the each variable of the program in the register; the detection module is configured to detect whether the life cycle of the each variable in the register overlaps another, and send a notification to the alarm module if the detection result is yes; and the alarm module is configured to report an alarm when receiving the notification sent by the detection module.</p> |