fixed a register allocation bug