Switched Context::errors() over to a field access
Now that Context owns the errors pointer, there is no magic behind its
accessor and no reason not to just use a straight field access.
Change-Id: I3f771f458ffdaf95d6289ba5767535a78126cc0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441312
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLConstantFolder.cpp b/src/sksl/SkSLConstantFolder.cpp
index f9824f5..50a656d 100644
--- a/src/sksl/SkSLConstantFolder.cpp
+++ b/src/sksl/SkSLConstantFolder.cpp
@@ -189,7 +189,7 @@
case Token::Kind::TK_PERCENT:
case Token::Kind::TK_PERCENTEQ:
if (contains_constant_zero(right)) {
- context.errors().error(offset, "division by zero");
+ context.fErrors->error(offset, "division by zero");
return true;
}
return false;
@@ -455,13 +455,13 @@
case Token::Kind::TK_STAR: return URESULT(*);
case Token::Kind::TK_SLASH:
if (leftVal == std::numeric_limits<SKSL_INT>::min() && rightVal == -1) {
- context.errors().error(offset, "arithmetic overflow");
+ context.fErrors->error(offset, "arithmetic overflow");
return nullptr;
}
return RESULT(/);
case Token::Kind::TK_PERCENT:
if (leftVal == std::numeric_limits<SKSL_INT>::min() && rightVal == -1) {
- context.errors().error(offset, "arithmetic overflow");
+ context.fErrors->error(offset, "arithmetic overflow");
return nullptr;
}
return RESULT(%);
@@ -480,13 +480,13 @@
// in C++, but not GLSL. Do the shift on unsigned values, to avoid UBSAN.
return URESULT(<<);
}
- context.errors().error(offset, "shift value out of range");
+ context.fErrors->error(offset, "shift value out of range");
return nullptr;
case Token::Kind::TK_SHR:
if (rightVal >= 0 && rightVal <= 31) {
return RESULT(>>);
}
- context.errors().error(offset, "shift value out of range");
+ context.fErrors->error(offset, "shift value out of range");
return nullptr;
default: