By shooting/rolling out Player B has ended Player A's inning and erased Player A's foul. Now Player B is on one foul and Player A is on zero.
It's been noted before that this rule can result in a situation where both Players could roll out back and forth forever. Which is why I recommend that after a foul, any foul, by Player A both players are now on One Foul which would make another foul (such as another push out) automatically give up Ball In Hand. Not a perfect solution, because it forces Player B to take a foul they didn't commit, but it avoids the infinite roll out possibility.
If Player B is facing a roll out that their opponent can make and Player B can't, well, they should figure out how to make that shot as soon as possible.
Where's the infinite roll out possibility? Both players can only be on 1 before one of them has to shoot the 2nd consecutive time. A roll is a shot, and a push is a shot.(both on 1) But remember it's broken down into consecutive turns and after a roll and a reroll(both are on 1) and you have to be on 1 before you shoot a 2nd consecutive time. Answer please!