浏览代码

* Removed null-termination in TXMLStreamInputSource.FetchData(): it isn't necessary and is causing unaligned access errors with ARM CPUs.

git-svn-id: trunk@14360 -
sergei 16 年之前
父节点
当前提交
a7d1856620
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      packages/fcl-xml/src/xmlread.pp

+ 5 - 1
packages/fcl-xml/src/xmlread.pp

@@ -1131,7 +1131,11 @@ begin
   if BytesRead < FCapacity then
     FEof := True;
   FCharBufEnd := FAllocated + (Slack-4) + BytesRead;
-  PWideChar(FCharBufEnd)^ := #0;
+  { Null-termination has been removed:
+    1) Built-in decoders don't need it because they respect the buffer length.
+    2) It was causing unaligned access errors on ARM CPUs.
+  }
+  //PWideChar(FCharBufEnd)^ := #0;
 end;
 
 { TXMLFileInputSource }