This website requires JavaScript.
ReeceSX
Explore
Aurora
Register
Sign In
AuroraMiddleware
/
skia2
Watch
1
Star
0
Fork
0
You've already forked skia2
Code
Issues
Pull Requests
Projects
Releases
Wiki
Activity
5d627f3eba
skia2
/
tests
/
sksl
/
errors
/
Ossfuzz31469.glsl
5 lines
91 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Fix fuzzer-discovered error with inlining. In http://review.skia.org/375776, an optimization was added to the Inliner, causing it to skip generation of unnecessary temporary variables. The fuzzer immediately discovered a flaw in this logic: the "unnecessary" variable was actually used in the rare case that a function failed to actually return a value. The inliner didn't detect this case. Of course, this isn't a valid program either, so now we report the error and cleanly fail. Change-Id: I1f201cfd33f45cace3be93765a4e214e43a46e69 Bug: oss-fuzz:31469, oss-fuzz:31525 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377101 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-01 15:08:08 +00:00
### Compilation failed:
Detect functions that fail to return a value, without using CFG. This check now runs at function finalization time, before constant propagation has occurred; this affected the "DeadIfStatement" test. Our detection isn't smart enough to realize that a loop will run zero times, so it treats `for` and `while` loops as always running at least once. This isn't strictly correct, but it actually mirrors how the CFG implementation works anyway. The only downside is that we would not flag code like `for (i=0; i<0; ++i) { return x; }` as an error. Change-Id: I5e43a6ee3a3993045559f0fb0646d36112543a94 Bug: skia:11377 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379056 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-04 21:00:20 +00:00
error: 1: function 'n' can exit without returning a value
Add return-value check to the function finalizer. Rather than have the inliner own this responsibility, the function finalizer now detects if a function is supposed to return a value but never actually does. This will allow us to detect this error case even if the inliner is disabled. The inliner should no longer encounter functions that claim to return a value but don't, so it will now assert if one is encountered. (The inliner still has the logic to handle this case gracefully, just in case.) The check is currently very simple and doesn't analyze the structure of the function, so it won't report cases where some paths return a value and others don't, e.g. this will pass the test: int func() { if (something()) return 123; } (This is good enough to resolve the inliner issue, though, as it only occurred in functions with no value-returns at all.) Change-Id: I21f13daffe66c8f2e72932b320ee268ba9207bfa Bug: oss-fuzz:31469, oss-fuzz:31525, skia:11377 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377196 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-03 15:46:44 +00:00
1 error
Reference in New Issue
Copy Permalink