@@ -736,7 +736,7 @@ def stack_analysis(
736
736
737
737
def get_stack_effect_info (
738
738
self , thing : parser .InstDef | parser .Super | parser .Macro
739
- ) -> tuple [Instruction , str , str ]:
739
+ ) -> tuple [Instruction | None , str , str ]:
740
740
741
741
def effect_str (effect : list [StackEffect ]) -> str :
742
742
if getattr (thing , 'kind' , None ) == 'legacy' :
@@ -752,6 +752,9 @@ def effect_str(effect: list[StackEffect]) -> str:
752
752
instr = self .instrs [thing .name ]
753
753
popped = effect_str (instr .input_effects )
754
754
pushed = effect_str (instr .output_effects )
755
+ else :
756
+ instr = None
757
+ popped = pushed = "" , ""
755
758
case parser .Super ():
756
759
instr = self .super_instrs [thing .name ]
757
760
popped = '+' .join (effect_str (comp .instr .input_effects ) for comp in instr .parts )
@@ -770,8 +773,9 @@ def write_stack_effect_functions(self) -> None:
770
773
pushed_data = []
771
774
for thing in self .everything :
772
775
instr , popped , pushed = self .get_stack_effect_info (thing )
773
- popped_data .append ( (instr , popped ) )
774
- pushed_data .append ( (instr , pushed ) )
776
+ if instr is not None :
777
+ popped_data .append ( (instr , popped ) )
778
+ pushed_data .append ( (instr , pushed ) )
775
779
776
780
def write_function (direction : str , data : list [tuple [Instruction , str ]]) -> None :
777
781
self .out .emit ("\n #ifndef NDEBUG" );
0 commit comments