Bug 597946 - ANGLE compiler freezes on shader with bad #ifdef (ANGLE bug 40) - r=vlad, a=blocking-betaN

This commit is contained in:
Benoit Jacob 2010-12-11 10:13:22 -05:00
Родитель a1f1fb9e83
Коммит ca3cc7125a
3 изменённых файлов: 31 добавлений и 3 удалений

Просмотреть файл

@ -7,6 +7,8 @@ Local patches:
angle-fixes.patch - fix angle issues 51 & 52
angle-bug-40.patch - fix angle issue 40: freeze when compiling bad #ifdef shader
== Visual Studio Solution Files ==
The VS solution/project files that are used to build ANGLE are built

Просмотреть файл

@ -0,0 +1,27 @@
# HG changeset patch
# Parent 29f85e1308509423edf7da745dcb5ad2b2c1d88d
diff --git a/gfx/angle/src/compiler/preprocessor/cpp.c b/gfx/angle/src/compiler/preprocessor/cpp.c
--- a/gfx/angle/src/compiler/preprocessor/cpp.c
+++ b/gfx/angle/src/compiler/preprocessor/cpp.c
@@ -489,19 +489,18 @@ static int CPPifdef(int defined, yystype
cpp->elsetracker++;
cpp->elsedepth[cpp->elsetracker] = 0;
if (token != CPP_IDENTIFIER) {
defined ? CPPErrorToInfoLog("ifdef"):CPPErrorToInfoLog("ifndef");
} else {
Symbol *s = LookUpSymbol(macros, name);
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
if (token != '\n') {
- CPPWarningToInfoLog("unexpected tokens following #ifdef preprocessor directive - expected a newline");
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
+ CPPErrorToInfoLog("unexpected tokens following #ifdef preprocessor directive - expected a newline");
+ return 0;
}
if (((s && !s->details.mac.undef) ? 1 : 0) != defined)
token = CPPelse(1, yylvalpp);
}
return token;
} // CPPifdef
static int CPPline(yystypepp * yylvalpp)

Просмотреть файл

@ -494,9 +494,8 @@ static int CPPifdef(int defined, yystypepp * yylvalpp)
Symbol *s = LookUpSymbol(macros, name);
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
if (token != '\n') {
CPPWarningToInfoLog("unexpected tokens following #ifdef preprocessor directive - expected a newline");
while (token != '\n')
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
CPPErrorToInfoLog("unexpected tokens following #ifdef preprocessor directive - expected a newline");
return 0;
}
if (((s && !s->details.mac.undef) ? 1 : 0) != defined)
token = CPPelse(1, yylvalpp);