diff --git a/.gitattributes b/.gitattributes index f004c0f60d..cf0c1bfe44 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6349,8 +6349,10 @@ tests/webtbs/tw4398.pp svneol=native#text/plain tests/webtbs/tw4427.pp svneol=native#text/plain tests/webtbs/tw4428.pp svneol=native#text/plain tests/webtbs/tw4450.pp svneol=native#text/plain +tests/webtbs/tw4477.pp svneol=native#text/plain tests/webtbs/tw4487.pp -text svneol=unset#text/plain tests/webtbs/tw4489.pp -text svneol=unset#text/plain +tests/webtbs/tw4496.pp svneol=native#text/plain tests/webtbs/ub1873.pp svneol=native#text/plain tests/webtbs/ub1883.pp svneol=native#text/plain tests/webtbs/uw0555.pp svneol=native#text/plain diff --git a/compiler/ptype.pas b/compiler/ptype.pas index 1e24339775..62ae3c9e23 100644 --- a/compiler/ptype.pas +++ b/compiler/ptype.pas @@ -308,7 +308,7 @@ implementation tt.setdef(torddef.create(uchar,lv,hv)) else if is_boolean(pt1.resulttype.def) then - tt.setdef(torddef.create(bool8bit,l,hv)) + tt.setdef(torddef.create(bool8bit,lv,hv)) else tt.setdef(torddef.create(range_to_basetype(lv,hv),lv,hv)); end; @@ -556,22 +556,12 @@ implementation Message(sym_e_ill_type_decl_set); orddef : begin - case torddef(tt2.def).typ of - uchar : - //!!! tt.setdef(tsetdef.create(tt2,0,255)); - tt.setdef(tsetdef.create(tt2,255)); - u8bit,u16bit,u32bit, - s8bit,s16bit,s32bit : - begin - if (torddef(tt2.def).low>=0) then - // !! tt.setdef(tsetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high)) - tt.setdef(tsetdef.create(tt2,torddef(tt2.def).high)) - else - Message(sym_e_ill_type_decl_set); - end; - else - Message(sym_e_ill_type_decl_set); - end; + if (torddef(tt2.def).typ<>uvoid) and + (torddef(tt2.def).low>=0) then + // !! tt.setdef(tsetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high)) + tt.setdef(tsetdef.create(tt2,torddef(tt2.def).high)) + else + Message(sym_e_ill_type_decl_set); end; else Message(sym_e_ill_type_decl_set); diff --git a/tests/webtbs/tw4477.pp b/tests/webtbs/tw4477.pp new file mode 100755 index 0000000000..75ae5f9d12 --- /dev/null +++ b/tests/webtbs/tw4477.pp @@ -0,0 +1,5 @@ +{ Source provided for Free Pascal Bug Report 4477 } +{ Submitted by "Alexey Moiseitsev" on 2005-10-30 } +{ e-mail: himeraster@gmail.com } +var f : set of boolean; +begin end. \ No newline at end of file diff --git a/tests/webtbs/tw4496.pp b/tests/webtbs/tw4496.pp new file mode 100755 index 0000000000..266c9d51be --- /dev/null +++ b/tests/webtbs/tw4496.pp @@ -0,0 +1,10 @@ +type + //BoolDeriv = Boolean; //gives no internal error + BoolDeriv = false..true; + +var + a: array[BoolDeriv] of char; + +begin + a[true] := 'a'; //ierror 99080501 here +end.