@@ -375,7 +375,14 @@ public static RootStatement codeToJava(StructClass cl, StructMethod mt, MethodDe
375375 decompileRecord .add ("CondenseDo" , root );
376376 continue ;
377377 }
378-
378+
379+ if (root .hasSwitch () && SwitchHelper .simplifySwitches (root , mt , root )) {
380+ SequenceHelper .condenseSequences (root ); // remove empty blocks
381+ decompileRecord .add ("SimplifySwitches" , root );
382+
383+ continue ;
384+ }
385+
379386 // Apply main loop plugin passes
380387 if (pluginContext .runPasses (JavaPassLocation .MAIN_LOOP , pctx )) {
381388 root = pctx .getRoot ();
@@ -401,26 +408,6 @@ public static RootStatement codeToJava(StructClass cl, StructMethod mt, MethodDe
401408 decompileRecord .resetMainLoop ();
402409 decompileRecord .add ("MainLoopEnd" , root );
403410
404- // this has to be done after all inlining is done so the case values do not get reverted
405- if (root .hasSwitch () && SwitchHelper .simplifySwitches (root , mt , root )) {
406- SequenceHelper .condenseSequences (root ); // remove empty blocks
407- decompileRecord .add ("SimplifySwitches" , root );
408-
409- // If we have simplified switches, try to make switch expressions
410- if (SwitchExpressionHelper .hasSwitchExpressions (root )) {
411- if (SwitchExpressionHelper .processSwitchExpressions (root )) {
412- decompileRecord .add ("ProcessSwitchExpr_SS" , root );
413-
414- // Simplify stack vars to integrate and inline switch expressions
415- StackVarsProcessor .simplifyStackVars (root , mt , cl );
416- decompileRecord .add ("SimplifyStackVars_SS" , root );
417-
418- varProc .setVarVersions (root );
419- decompileRecord .add ("SetVarVersions_SS" , root );
420- }
421- }
422- }
423-
424411 // Makes constant returns the same type as the method descriptor
425412 if (ExitHelper .adjustReturnType (root , md )) {
426413 decompileRecord .add ("AdjustReturnType" , root );
0 commit comments