From a purely ethical standpoint, the self-driving car should swerve into the barrier, sacrificing the passenger to save the five pedestrians. Here’s the reasoning:

1. **Utilitarian Perspective**:  
   The principle of maximizing overall well-being (or minimizing harm) leads to the conclusion that saving five lives at the expense of one is ethically preferable. This approach prioritizes the greatest good for the greatest number, even if it requires making a difficult choice between active and passive harm.

2. **Moral Equivalence of Outcomes**:  
   Philosophically, the distinction between *actively causing* a death (swerving) and *passively allowing* deaths (continuing straight) is debated. While some deontological frameworks condemn active intervention, others argue that outcomes matter more. Since both actions result in death—either the passenger or the pedestrians—the ethical imperative to reduce total harm takes precedence.

3. **Autonomy and Consent**:  
   While passengers might expect safety, autonomous vehicles inherently involve programming decisions about risk. If passengers implicitly accept that the car could prioritize minimizing harm in extreme scenarios, swerving aligns with societal expectations of moral responsibility in crisis situations.

4. **Societal Trust in Autonomous Systems**:  
   Programming cars to minimize casualties could foster broader trust in autonomous technology, as people might feel safer knowing vehicles aim to reduce overall harm rather than prioritize individual passengers unilaterally.

5. **Critique of Absolutism**:  
   Ethical absolutism (e.g., "never kill") risks greater harm in this scenario. Allowing five deaths by refusing to swerve could be seen as a failure to act against preventable loss of life, undermining the moral duty to protect human life wherever possible.

In summary, while ethical theories diverge, the utilitarian argument—paired with the moral weight of preventing greater harm—provides the strongest justification for the car to swerve. This decision reflects a commitment to minimizing suffering, even in ethically unpalatable circumstances.