commit | 12944c84c9216b8a13ffcaf320a3bc639ae34460 | [log] [tgz] |
---|---|---|
author | Corentin Wallez <cwallez@chromium.org> | Fri Mar 27 16:50:11 2020 +0000 |
committer | Commit Bot service account <commit-bot@chromium.org> | Fri Mar 27 16:50:11 2020 +0000 |
tree | fe2fbc6cde84caf6af4ef93133d2c00eea3222a7 | |
parent | ffd94da5f1dfc29ba8656201ae50b95add303575 [diff] |
Metal: Don't crash on invalid shaders MetalFunctionData::function was uninitialized when an error happened its destructor would run, calling release on a garbage pointer. Bug: Change-Id: Ib72038da2a07b4e0f27ec929ec08f303c54dcc62 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17760 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/metal/ShaderModuleMTL.h b/src/dawn_native/metal/ShaderModuleMTL.h index 2e447c1..b270034 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.h +++ b/src/dawn_native/metal/ShaderModuleMTL.h
@@ -36,7 +36,7 @@ const ShaderModuleDescriptor* descriptor); struct MetalFunctionData { - id<MTLFunction> function; + id<MTLFunction> function = nil; MTLSize localWorkgroupSize; bool needsStorageBufferLength; ~MetalFunctionData() {