diff --git a/.gitattributes b/.gitattributes index 93399fcb41..c48b76f6fd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8477,6 +8477,7 @@ tests/webtbs/tw9766.pp svneol=native#text/plain tests/webtbs/tw9827.pp svneol=native#text/plain tests/webtbs/tw9894.pp svneol=native#text/plain tests/webtbs/tw9894a.pp svneol=native#text/plain +tests/webtbs/tw9897.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/rtl/inc/system.inc b/rtl/inc/system.inc index 36d67e4f91..de288600a9 100644 --- a/rtl/inc/system.inc +++ b/rtl/inc/system.inc @@ -40,9 +40,10 @@ const { For Error Handling.} ErrorBase : Pointer = nil; -{ Used by the ansistrings and maybe also other things in the future } +{ Used by the ansi/widestrings and maybe also other things in the future } var - emptychar : char;public name 'FPC_EMPTYCHAR'; + { widechar, because also used by widestring -> pwidechar conversions } + emptychar : widechar;public name 'FPC_EMPTYCHAR'; initialstklen : SizeUint;external name '__stklen'; { checks whether the given suggested size for the stack of the current diff --git a/tests/webtbs/tw9897.pp b/tests/webtbs/tw9897.pp new file mode 100644 index 0000000000..512208045d --- /dev/null +++ b/tests/webtbs/tw9897.pp @@ -0,0 +1,15 @@ +program widecharbug; + +var + AText : WideString; + AWideChar: PWideChar; + +begin + AText := ''; + AWideChar := PWideChar(AText); + if PWord(AWideChar)^<>0 then + begin + writeln(PWord(AWideChar)^); + halt(1); + end; +end.