File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ class Optimizer:
7171 )
7272 _re_jump : typing .ClassVar [re .Pattern [str ]] = _RE_NEVER_MATCH # One group: target.
7373 _re_label : typing .ClassVar [re .Pattern [str ]] = re .compile (
74- r" \s*(?P<label>[\w\. ]+):"
74+ r' \s*(?P<label>[\w"$.?@ ]+):'
7575 ) # One group: label.
7676 _re_noise : typing .ClassVar [re .Pattern [str ]] = re .compile (
77- r"\s*(?:[#\ .]|$)"
77+ r"\s*(?:[#.]|$)"
7878 ) # No groups.
7979 _re_return : typing .ClassVar [re .Pattern [str ]] = _RE_NEVER_MATCH # No groups.
8080
@@ -257,6 +257,8 @@ def _remove_dead_code(self) -> None:
257257 todo .append (block .link )
258258 for block in self ._blocks ():
259259 if block not in reachable :
260+ block .target = None
261+ block .fallthrough = True
260262 block .instructions .clear ()
261263
262264 def _remove_redundant_jumps (self ) -> None :
@@ -301,9 +303,9 @@ class OptimizerX86(Optimizer):
301303
302304 _branches = _X86_BRANCHES
303305 _re_branch = re .compile (
304- rf"\s*(?P<instruction>{ '|' .join (_X86_BRANCHES )} )\s+(?P<target>[\w\ .]+)"
306+ rf"\s*(?P<instruction>{ '|' .join (_X86_BRANCHES )} )\s+(?P<target>[\w.]+)"
305307 )
306- _re_jump = re .compile (r"\s*jmp\s+(?P<target>[\w\ .]+)" )
308+ _re_jump = re .compile (r"\s*jmp\s+(?P<target>[\w.]+)" )
307309 _re_return = re .compile (r"\s*ret\b" )
308310
309311 @staticmethod
You can’t perform that action at this time.
0 commit comments