Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improper russian coments parsing #28

Open
tantra35 opened this issue May 13, 2013 · 2 comments
Open

improper russian coments parsing #28

tantra35 opened this issue May 13, 2013 · 2 comments

Comments

@tantra35
Copy link

Here is small patch that fixex problem

HG changeset patch

User [email protected]

Date 1368443820 -14400

Node ID 12d32e5bf970674fd75539054a6c1734e9bdefc7

Parent d0e13408f0338ccefb6ac08cb237ad4662cf01bb

fix russian comments parsing

diff --git a/hlslang/MachineIndependent/preprocessor/scanner.c b/hlslang/MachineIndependent/preprocessor/scanner.c
--- a/hlslang/MachineIndependent/preprocessor/scanner.c
+++ b/hlslang/MachineIndependent/preprocessor/scanner.c
@@ -15,7 +15,7 @@

typedef struct StringInputSrc {
InputSrc base;

  • char *p;
  • unsigned char *p;
    } StringInputSrc;

static int eof_scan1(InputSrc *is)

@aras-p
Copy link
Owner

aras-p commented May 13, 2013

I'm not quite sure I understand the patch; or github formats it in a weird way. Is the code change changing char* to unsigned char* ? Why would this fix the problem?

@tantra35
Copy link
Author

Its very simple, for example russian letterrs codes (in cp1251) bigger then
128 so they have signed semantic, and in str_getch(InputSrc* arg) function
due type conversion they present as signed int and in hex 0xffffff<leter
code(2 bytes)>, but must be 0x000000<leter code(2 bytes)>, and as a finally
result russain letter "я" have hex code 0xff, so it will be presented as
0xffffffff, ant this will be interpreted as EOF. This patch remove this
improper type conversion

2013/5/13 Aras Pranckevičius [email protected]

I'm not quite sure I understand the patch; or github formats it in a weird
way. Is the code change changing char* to unsigned char* ? Why would this
fix the problem?


Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-17806721
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants