diff --git a/compiler/nmat.pas b/compiler/nmat.pas index 87370c570d..d39fa67393 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -283,19 +283,32 @@ implementation (not is_signed(ld) and (rd.size >= ld.size))) then begin - inserttypeconv(left,right.resultdef); - ld:=torddef(left.resultdef); - end; - if (ld.ordtype in [u8bit,u16bit,u32bit,u64bit]) and + if rd.size= 0) and (tordconstnode(right).value <= get_max_value(ld))) or (not is_signed(rd) and (ld.size >= rd.size))) then - begin - inserttypeconv(right,left.resultdef); - rd:=torddef(right.resultdef); - end; + begin + if ld.size