The marines stopped at the Yalu, and at that point MacArthur had defeated the North Korean army. But the Chinese Liberation Army, far more numerous than the UN forces, launched a somewhat sneak attack on the UN forces, and the marines had to walk back in the middle of winter. MacArthur then wanted to drop nukes on China, but Truman wouldn't let him, as this would have led to a wider war with unpredictable consequences, but likely dragging in the USSR, which supplied arms to the Chinese and the North Koreans. Most notably T-34 tanks and MIG fighters with swept-back wings, which the USAF didn't have until later in the war. Some of the MIGs were flown by Russian pilots. Subsequently the UN forces were forced to retreat and North Korea was reestablished as a communist state, with Chinese support. So, the US was not in a position to cross into China, short of nuclear war. 
The stalemate continues and isn't going to end anytime soon, while the Chinese military gets stronger by the day.