The regulation is going to get really bad with self-driving cars. There are so many bad things you can do with an autonomous vehicle. Regulators will demand that code must be carefully vetted by government agencies before it can be installed on any of these platforms.
Advanced robots will likely be in the same situation. The trend for drones has been foreshadowing this with more and more locking down of who is allowed to program them and what they are allowed to do.
Unlikely. Regulators really aren't interested in doing code auditing. They don't have the technical ability to find code problems, and the code by itself (separate from hardware and data) is mostly meaningless. They're more likely to impose an additional functional safety test suite on all autonomous vehicle manufacturers, which would be a good thing.
Advanced robots will likely be in the same situation. The trend for drones has been foreshadowing this with more and more locking down of who is allowed to program them and what they are allowed to do.