From 1e136b0cc7ff37f900adcb91b2783962cf9d7622 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 4 Oct 2021 22:18:53 +0200 Subject: [PATCH] * bail out early in MatchInstruction --- compiler/x86/aoptx86.pas | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/x86/aoptx86.pas b/compiler/x86/aoptx86.pas index 9e3eea96d7..5f9fc9eb7f 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -278,15 +278,16 @@ unit aoptx86; op : TAsmOp; begin result:=false; + if (instr.typ <> ait_instruction) or + ((opsize <> []) and not(taicpu(instr).opsize in opsize)) then + exit; for op in ops do begin - if (instr.typ = ait_instruction) and - (taicpu(instr).opcode = op) and - ((opsize = []) or (taicpu(instr).opsize in opsize)) then - begin - result:=true; - exit; - end; + if taicpu(instr).opcode = op then + begin + result:=true; + exit; + end; end; end;