1992 Subaru SVX Engine Stalls

My Subaru SVX stalls and immediately restarts. It does not seem to matter what speed I am traveling (or sittiing at idle) or if the engine is cold or hot. The engine has a slight roughness at idle. The check engine light was on and it was an oxygen sensor code, which was replaced. The problem persists.