mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 09:47:52 +02:00
* 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:
parent
0cb92962e3
commit
6d54046300
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
8
tests/tbf/tb0248.pp
Normal file
@ -0,0 +1,8 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tb0248;
|
||||
var
|
||||
p: PByte;
|
||||
begin
|
||||
p := 5 + nil;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user