* output a proper error message in case number+nil is encountered (just like

it's already done for nil+number and nil-number)

git-svn-id: trunk@28225 -
This commit is contained in:
nickysn 2014-07-15 22:26:58 +00:00
parent 0cb92962e3
commit 6d54046300
3 changed files with 11 additions and 0 deletions

1
.gitattributes vendored
View File

@ -9617,6 +9617,7 @@ tests/tbf/tb0244.pp svneol=native#text/pascal
tests/tbf/tb0245.pp svneol=native#text/pascal
tests/tbf/tb0246.pp svneol=native#text/pascal
tests/tbf/tb0247.pp svneol=native#text/pascal
tests/tbf/tb0248.pp svneol=native#text/pascal
tests/tbf/ub0115.pp svneol=native#text/plain
tests/tbf/ub0149.pp svneol=native#text/plain
tests/tbf/ub0158a.pp svneol=native#text/plain

View File

@ -1970,6 +1970,8 @@ implementation
inserttypeconv(left,get_int_type_for_pointer_arithmetic(rd));
if nodetype=addn then
begin
if (rt=niln) then
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,'NIL');
if not(cs_extsyntax in current_settings.moduleswitches) or
(not (is_pchar(ld) or is_chararray(ld) or is_open_chararray(ld) or is_widechar(ld) or is_widechararray(ld) or is_open_widechararray(ld)) and
not(cs_pointermath in current_settings.localswitches) and

8
tests/tbf/tb0248.pp Normal file
View File

@ -0,0 +1,8 @@
{ %FAIL }
program tb0248;
var
p: PByte;
begin
p := 5 + nil;
end.