fix index out of bounds error of x86_64 ABI
auto merge of #5779 : crabtw/rust/x86_64_abi, r=sanxiyn

This fixes #5754.