fixed an skslc crash with uninitialized globals

Bug: oss-fuzz:14372
Change-Id: I9445a36a7d7b04ba63f1e5c9b1d1bd270708a7c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219481
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Ethan Nicholas 2019-06-11 10:18:58 -04:00 committed by Skia Commit-Bot
parent d188c18835
commit 53bd4c5d4e

View File

@ -53,8 +53,9 @@ struct Variable : public Symbol {
}
bool dead() const {
if (fModifiers.fFlags & (Modifiers::kIn_Flag | Modifiers::kOut_Flag |
Modifiers::kUniform_Flag)) {
if ((fStorage != kLocal_Storage && fReadCount) ||
(fModifiers.fFlags & (Modifiers::kIn_Flag | Modifiers::kOut_Flag |
Modifiers::kUniform_Flag))) {
return false;
}
return !fWriteCount ||