@@ -541,29 +541,32 @@ class IROptimizer {
541541 state = state . clone ( ) ;
542542 }
543543
544- modified = this . analyzeInputs ( inputs , state ) || modified ;
545-
546544 switch ( stackBlock . opcode ) {
547545 case StackOpcode . VAR_SET :
546+ modified = this . analyzeInputs ( inputs , state ) || modified ;
548547 modified = state . setVariableType ( inputs . variable , inputs . value . type ) || modified ;
549548 break ;
550549 case StackOpcode . CONTROL_WHILE :
551550 case StackOpcode . CONTROL_FOR :
552551 case StackOpcode . CONTROL_REPEAT :
552+ modified = this . analyzeInputs ( inputs , state ) || modified ;
553553 modified = this . analyzeLoopedStack ( inputs . do , state , stackBlock ) || modified ;
554554 break ;
555555 case StackOpcode . CONTROL_IF_ELSE : {
556+ modified = this . analyzeInputs ( inputs , state ) || modified ;
556557 const trueState = state . clone ( ) ;
557558 modified = this . analyzeStack ( inputs . whenTrue , trueState ) || modified ;
558559 modified = this . analyzeStack ( inputs . whenFalse , state ) || modified ;
559560 modified = state . or ( trueState ) || modified ;
560561 break ;
561562 }
562563 case StackOpcode . CONTROL_STOP_SCRIPT : {
564+ modified = this . analyzeInputs ( inputs , state ) || modified ;
563565 this . addPossibleExitState ( state ) ;
564566 break ;
565567 }
566568 case StackOpcode . PROCEDURE_CALL : {
569+ modified = this . analyzeInputs ( inputs , state ) || modified ;
567570 modified = this . analyzeInputs ( inputs . inputs , state ) || modified ;
568571 const script = this . ir . procedures [ inputs . variant ] ;
569572
@@ -575,6 +578,7 @@ class IROptimizer {
575578 break ;
576579 }
577580 case StackOpcode . COMPATIBILITY_LAYER : {
581+ modified = this . analyzeInputs ( inputs , state ) || modified ;
578582 this . analyzeInputs ( inputs . inputs , state ) ;
579583 for ( const substackName in inputs . substacks ) {
580584 const newState = state . clone ( ) ;
@@ -583,6 +587,9 @@ class IROptimizer {
583587 }
584588 break ;
585589 }
590+ default :
591+ modified = this . analyzeInputs ( inputs , state ) || modified ;
592+ break ;
586593 }
587594
588595 return modified ;
0 commit comments