handle switches that reach phis appearing before them; fixes emscripen issue 2244