From e1763b80a547af73c0ec6a35e324c006c1a1216b Mon Sep 17 00:00:00 2001 From: Xinlong Hu <118075581+XinlongCS@users.noreply.github.com> Date: Thu, 26 Jun 2025 18:10:07 -0500 Subject: [PATCH] Additional 3.9/3.10 Exception test cases finished --- .../templates/Exception.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pylingual/control_flow_reconstruction/templates/Exception.py b/pylingual/control_flow_reconstruction/templates/Exception.py index cb6e225..4f64926 100644 --- a/pylingual/control_flow_reconstruction/templates/Exception.py +++ b/pylingual/control_flow_reconstruction/templates/Exception.py @@ -384,10 +384,10 @@ class ExcBody3_9(ControlFlowTemplate): class NamedExc3_9(ExcBody3_9): template = T( - header=N("body", None).with_cond(with_instructions("POP_TOP", "STORE_FAST")), + header=~N("body", None).with_cond(with_instructions("POP_TOP", "STORE_FAST")), body=N("normal_cleanup", None, "exception_cleanup"), - normal_cleanup=N("tail.").with_cond(with_instructions("STORE_FAST", "DELETE_FAST")), - exception_cleanup=N.tail().with_cond(with_instructions("STORE_FAST", "DELETE_FAST")), + normal_cleanup=~N("tail.").with_cond(with_instructions("STORE_FAST", "DELETE_FAST")), + exception_cleanup=~N.tail().with_cond(with_instructions("STORE_FAST", "DELETE_FAST")), tail=N.tail(), ) @@ -398,8 +398,8 @@ class NamedExc3_9(ExcBody3_9): class BareExcept3_9(Except3_9): template = T( - except_body=~N("tail.", None).with_cond(with_instructions("POP_EXCEPT")).with_cond(has_incoming_edge_of_categories("exception", "false_jump")), - tail=N.tail(), + except_body=~N("tail.", None).with_cond(starting_instructions("POP_TOP", "POP_TOP", "POP_TOP")).with_cond(has_incoming_edge_of_categories("exception", "false_jump")), + tail=~N.tail(), ) try_match = revert_on_fail( @@ -421,7 +421,7 @@ class BareExcept3_9(Except3_9): class ExceptExc3_9(Except3_9): template = T( - except_header=N("body", "falsejump"), + except_header=~N("body", "falsejump"), body=~N("tail.").of_subtemplate(ExcBody3_9), falsejump=~N("tail.").of_subtemplate(Except3_9), tail=N.tail(),