From 12944c84c9216b8a13ffcaf320a3bc639ae34460 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Fri, 27 Mar 2020 16:50:11 +0000 Subject: [PATCH] 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 Commit-Queue: Corentin Wallez --- src/dawn_native/metal/ShaderModuleMTL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dawn_native/metal/ShaderModuleMTL.h b/src/dawn_native/metal/ShaderModuleMTL.h index 2e447c1796..b270034d5d 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.h +++ b/src/dawn_native/metal/ShaderModuleMTL.h @@ -36,7 +36,7 @@ namespace dawn_native { namespace metal { const ShaderModuleDescriptor* descriptor); struct MetalFunctionData { - id function; + id function = nil; MTLSize localWorkgroupSize; bool needsStorageBufferLength; ~MetalFunctionData() {