Commit 964df49d by Gus Fernandez Committed by Shannon Woods

Fix a crash with the WebGL conformance test suite.

Undefined behavior caused by an overflowed enum was causing the translator symbol table stack to not get popped correctly when the compiler completed, causing dangling symbols who's storage was reclaimed and reused when the allocation pool was popped. The error occurred in the "shader-with-reserved-words" test, which passes when the compiler fails due to the use of reserved words as identifiers. As such, this test would pass even if the GPU process crashes but further tests in the test suite would fail. BUG=angle::785, 786 Change-Id: I365cb55f962f8dfe409f40532effeb10b8189432 Reviewed-on: https://chromium-review.googlesource.com/223093Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarNicolas Capens <capn@chromium.org> Tested-by: 's avatarGus Fernandez <gusfernandez@chromium.org>
parent 7865b70c
......@@ -299,14 +299,15 @@ class TSymbolTableLevel
tLevel level;
};
enum ESymbolLevel
{
COMMON_BUILTINS = 0,
ESSL1_BUILTINS = 1,
ESSL3_BUILTINS = 2,
LAST_BUILTIN_LEVEL = ESSL3_BUILTINS,
GLOBAL_LEVEL = 3
};
// Define ESymbolLevel as int rather than an enum since level can go
// above GLOBAL_LEVEL and cause atBuiltInLevel() to fail if the
// compiler optimizes the >= of the last element to ==.
typedef int ESymbolLevel;
const int COMMON_BUILTINS = 0;
const int ESSL1_BUILTINS = 1;
const int ESSL3_BUILTINS = 2;
const int LAST_BUILTIN_LEVEL = ESSL3_BUILTINS;
const int GLOBAL_LEVEL = 3;
class TSymbolTable
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment