diff --git a/.gitattributes b/.gitattributes index f150e5b15b..051a30f261 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6830,6 +6830,7 @@ tests/tbs/tb0543.pp svneol=native#text/plain tests/tbs/tb0544.pp svneol=native#text/plain tests/tbs/tb0545.pp svneol=native#text/plain tests/tbs/tb0546.pp svneol=native#text/plain +tests/tbs/tb0547.pp svneol=native#text/plain tests/tbs/tb205.pp svneol=native#text/plain tests/tbs/ub0060.pp svneol=native#text/plain tests/tbs/ub0069.pp svneol=native#text/plain diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas index 4ae7c44a35..40d25dbbd3 100644 --- a/compiler/pdecvar.pas +++ b/compiler/pdecvar.pas @@ -605,8 +605,8 @@ implementation setconstn : p.default:=plongint(tsetconstnode(pt).value_set)^; ordconstn : - if (Tordconstnode(pt).valueint64(high(p.default))) then + if (Tordconstnode(pt).valueint64(high(cardinal))) then message(parser_e_range_check_error) else p.default:=longint(tordconstnode(pt).value.svalue); diff --git a/tests/tbs/tb0547.pp b/tests/tbs/tb0547.pp new file mode 100644 index 0000000000..d71451ddea --- /dev/null +++ b/tests/tbs/tb0547.pp @@ -0,0 +1,21 @@ +{ %norun } + +program rangeerror; +{$ifdef FPC}{$mode objfpc}{$h+}{$endif} +{$ifdef mswindows}{$apptype console}{$endif} +uses +{$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif} +sysutils; +type +colorty = type longword; +const +cl_mapped = colorty($90000000); +type +ttestclass = class + private + fcolor: colorty; + published + property color: colorty read fcolor write fcolor default cl_mapped; //<<-- +end; +begin +end.