diff --git a/.gitattributes b/.gitattributes index f7a8e01869..24a4d97245 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5496,6 +5496,7 @@ tests/webtbf/tw4111.pp svneol=native#text/plain tests/webtbf/tw4139.pp svneol=native#text/plain tests/webtbf/tw4144.pp svneol=native#text/plain tests/webtbf/tw4153.pp svneol=native#text/plain +tests/webtbf/tw4227.pp svneol=native#text/plain tests/webtbf/tw4256.pp svneol=native#text/plain tests/webtbf/uw0744.pp svneol=native#text/plain tests/webtbf/uw0840a.pp svneol=native#text/plain diff --git a/compiler/ninl.pas b/compiler/ninl.pas index 65d3cf96d6..ae469afd64 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -597,7 +597,7 @@ implementation end; pointerdef : begin - if not is_pchar(para.left.resulttype.def) then + if (not is_pchar(para.left.resulttype.def)) or do_read then begin CGMessagePos(para.fileinfo,type_e_cant_read_write_type); error_para := true; diff --git a/tests/webtbf/tw4227.pp b/tests/webtbf/tw4227.pp new file mode 100644 index 0000000000..9cc8ae24e2 --- /dev/null +++ b/tests/webtbf/tw4227.pp @@ -0,0 +1,7 @@ +{ %FAIL } +var + p : pchar; + +begin + readln(p); +end.