Go to file
John Stiles 5cec187b36 Fix array timeout discovered by the fuzzer.
The fuzzer discovered that, when we attempt to verify that an array
doesn't contain any literal values that are out-of-range for its base
type, we pay a linear-time cost based on the size of the array. This
happens even when the array value isn't known at compile time; we still
iterate over its slot count and diligently discover that every single
constant-subexpression slot in the expression is "null".

We now have a helper function on Expression,
`allowsConstantSubexpressions`, which only returns true for expression
kinds that can contain constant subexpressions. We use this helper to
skip over this linear-per-subexpression check when the expression
cannot possibly contain a constant subexpression. In particular,
`AnyConstructor::compareConstant` and `Type::checkForOutOfRangeLiteral`
will now early-out for expressions that can't possibly contain a
constant subexpression.

Change-Id: Ia34e422afa67b478a8616acb0a0e9cd211b29698
Bug: oss-fuzz:37900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444136
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-08-31 19:55:45 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bazel bazel baby steps 2020-09-14 15:18:32 +00:00
bench Fix compilation with "skia_enable_skparagraph = false" 2021-08-31 18:50:20 +00:00
bin Always use python3 to run fetch-sk. 2021-08-31 13:16:22 +00:00
build/fuchsia [fuchsia] Fix fidlc command. 2020-06-10 03:29:24 +00:00
build_overrides fix tint roll - enable tint_build_wgsl_writer 2021-07-01 00:32:40 +00:00
client_utils/android Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
demos.skia.org Convert internal sample() calls to shade/filter/blend 2021-08-24 21:03:44 +00:00
dm Fix compilation w/ "skia_enable_svg = false" (take 2) 2021-08-31 18:28:25 +00:00
docker [infra] Update cmake docker image to be Debian 10 2021-07-23 11:21:31 +00:00
docs/examples Reland "Add sRGB 8888 colortype" 2021-08-24 12:56:32 +00:00
example Remove SDL from DEPS (and SDL example that used it) 2021-05-27 21:37:57 +00:00
experimental Reland "Simplify SkRasterClip now that it's only intersect/diff" 2021-08-31 18:16:31 +00:00
fuzz Fix compilation with "skia_enable_skparagraph = false" 2021-08-31 18:50:20 +00:00
gm Store the correct number of samples in GrProgramInfo 2021-08-26 17:24:47 +00:00
gn Fix array timeout discovered by the fuzzer. 2021-08-31 19:55:45 +00:00
include Rename some GrD3DTypes* header files. 2021-08-31 18:49:46 +00:00
infra Roll SwiftShader from 9eb5acaba94c to 6aad52e1aef6 (5 revisions) 2021-08-30 17:03:52 +00:00
modules Fix compilation with "skia_enable_skparagraph = false" 2021-08-31 18:50:20 +00:00
platform_tools [JetSki] pass SkPaint into experimental SkText drawText calls 2021-08-26 13:01:51 +00:00
resources Fix array timeout discovered by the fuzzer. 2021-08-31 19:55:45 +00:00
samplecode Fix compilation w/ "skia_enable_svg = false" (take 2) 2021-08-31 18:28:25 +00:00
site Convert internal sample() calls to shade/filter/blend 2021-08-24 21:03:44 +00:00
specs [infra] Port serve.py from Python2 to 3 2021-08-31 15:28:19 +00:00
src Fix array timeout discovered by the fuzzer. 2021-08-31 19:55:45 +00:00
tests Fix array timeout discovered by the fuzzer. 2021-08-31 19:55:45 +00:00
third_party Roll skcms from b3fa31431c6a to 4f7135f89d98 (1 revision) 2021-08-25 20:09:24 +00:00
tools Fix compilation w/ "skia_enable_svg = false" (take 2) 2021-08-31 18:28:25 +00:00
.bazelignore bazel baby steps 2020-09-14 15:18:32 +00:00
.clang-format no more bin packing in .clang-format 2021-03-04 17:22:50 +00:00
.clang-tidy Disable ClangTidy namespace comments for short blocks. 2020-08-24 14:01:22 +00:00
.gitignore add mskps/ to .gitignore 2021-07-06 21:04:55 +00:00
.gn Pre-emptive fix for upcoming ANGLE change. 2021-01-08 17:23:52 +00:00
AUTHORS Correct a typo in build_workaround_header.py 2021-07-29 13:06:01 +00:00
BUILD.bazel bazel baby steps 2020-09-14 15:18:32 +00:00
BUILD.gn Remove blend and colorFilter sksl modules 2021-08-31 17:35:19 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll ANGLE from 3a9df22fcc51 to 27517801121e (1 revision) 2021-08-31 06:20:16 +00:00
DIR_METADATA Move metadata in OWNERS files to DIR_METADATA files 2021-02-02 23:41:54 +00:00
go.mod [commandbuffer] Update infra dep to fix CommandBuffer 2021-08-27 16:44:47 +00:00
go.sum [commandbuffer] Update infra dep to fix CommandBuffer 2021-08-27 16:44:47 +00:00
LICENSE LICENSE file: clean up 2019-11-22 21:59:03 +00:00
OWNERS [infra] Add wildcard OWNERS 2021-08-30 19:19:34 +00:00
PRESUBMIT.py [infra] Update PRESUBMIT.py to run under Python3 2021-08-16 20:00:46 +00:00
public.bzl Separate SkUnicode bazel source sets 2021-08-09 18:23:15 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
RELEASE_NOTES.txt SkSL: Use type-specific sampling intrinsics, rather than fn-call syntax 2021-08-24 18:18:46 +00:00
whitespace.txt Test SkCQ 2021-07-24 21:07:28 +00:00
WORKSPACE.bazel bazel baby steps 2020-09-14 15:18:32 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.