pyscripter / SynEdit

SynEdit is a syntax highlighting edit control, not based on the Windows common controls.
26 stars 11 forks source link

Range check error in ShrinkAtWideGlyphs #16

Closed MShark67 closed 4 years ago

MShark67 commented 4 years ago

I hit this while testing a file with the line: 영어 명 and just moving the caret from the beginning of the line and then moving forward causes it. It looks like:

while (S[i] = FillerChar) do
  inc(i);

needs a check for Length on i.

-Mark

pyscripter commented 4 years ago

Thanks.

The code of ShrinkAtWideGlyphs looks OK to me. FillerChar would always be followed by a valid char. But maybe the error comes from where the function is called (fortunately just one place). I will have a look.

Are you using word-wrap?

MShark67 commented 4 years ago

No word wrap. Debug mode with range checking on. 32bit Delphi 10.4. I can cause it with just those characters and moving the character as mentioned. From my debugging it does look like the last char in the string is a fillerchar (so it seems like it's possible for a fillerchar to end the passed string, which certainly could be an "outside that function" issue.) That sample text is from a Unicode test file I use with the word "English" in 15 or so languages.

pyscripter commented 4 years ago

Fixed at https://github.com/TurboPack/