View Revisions: Issue #38734

Summary 0038734: TStreamReader (streamex unit) issue
Revision 2021-04-17 14:30 by Marco van de Voort
Description TStreamReader.ReadLine seems to fail under specific circumstances.
I created a test to easily reproduce the problem.
The test makes use of a TStream that behaves in a weird, but formally correct way. I created it based on a real experience with the StdIn that I was able to reproduce thanks to pre-existing logging.

I believe the bug can be fixed by updating VPByte right after FillBuffer is called:

      [...]
      FillBuffer;
      VPByte := @FBuffer[FBufferPosition]; //bugfix
      VPosition := FBufferPosition;
      [...]

Revision 2021-04-09 11:57 by Andrea Mauri
Description TStreamReader.ReadLine seems to fail under specific circumstances.
I created a test to easily reproduce the problem.
The test makes use of a TStream that behaves in a weird, but formally correct way. I created it based on a real experience with the StdIn that I was able to reproduce thanks to pre-existing logging.

I believe the bug can be fixed by updating VPByte right after FillBuffer is called:

      [...]
      FillBuffer;
      VPByte := @FBuffer[FBufferPosition]; //bugfix
      VPosition := FBufferPosition;
      [...]