14a487fd54
The only type of expressions that getConstantSubexpression could ever return are Literal and nullptr. getConstantValue now returns an optional<double>; nullopt indicates a non-constant value in the slot. This simplifies most use cases, and allows us to get rid of some extra "zero" and "one" Literal objects in some of our Constructor classes. This change fixes a recent fuzzer issue. The fuzzer had discovered that calling `getConstantSubexpression` on a ConstructorCompoundCast that contained a compile-time-constant value would return literals of the wrong type (the cast was not applied). By nesting repeated matrix casts, this type confusion could be turned into an assertion. Change-Id: Icee69219e6db2822ffdfab4e5ccdaff54584a4b6 Bug: oss-fuzz:41000 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471376 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> |
||
---|---|---|
.. | ||
ArrayFolding.glsl | ||
ArraySizeFolding.glsl | ||
AssignmentOps.glsl | ||
BoolFolding.glsl | ||
CastFolding.glsl | ||
FloatFolding.glsl | ||
IntFoldingES2.glsl | ||
IntFoldingES3.glsl | ||
MatrixFoldingES2.glsl | ||
MatrixFoldingES3.glsl | ||
SelfAssignment.glsl | ||
ShortCircuitBoolFolding.glsl | ||
SwizzleFolding.glsl | ||
VectorScalarFolding.glsl | ||
VectorVectorFolding.glsl |