Fix heap overrun problem in x86_64 environment.