Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e539895bcf659b539c497b2de41b841c24deffa3
      
https://github.com/WebKit/WebKit/commit/e539895bcf659b539c497b2de41b841c24deffa3
  Author: Ruthvik Konda <[email protected]>
  Date:   2026-05-01 (Fri, 01 May 2026)

  Changed paths:
    M Source/ThirdParty/ANGLE/src/compiler/translator/msl/TranslatorMSL.cpp
    M 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/AddDefaultReturnStatements.h
    M Source/ThirdParty/ANGLE/src/tests/gl_tests/GLSLTest.cpp

  Log Message:
  -----------
  ANGLE: Metal: Add zero-init return for functions missing return statements
https://bugs.webkit.org/show_bug.cgi?id=306322
rdar://168050123

Reviewed by Kimmo Kinnunen.

GLSL functions that flow off the end are allowed. However in MSL, this leads to 
undefined behavior
which can cause garbage memory to be written to the framebuffer. To fix this, 
we add a return statement
with zero init values for functions that are missing return statements.

HLSL backend already does this and it's backend agnostic. So we move the 
appropriate files to the common tree_ops folder
and add it as the first pass in translateImpl().

* Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj:
* Source/ThirdParty/ANGLE/Compiler.cmake:
* Source/ThirdParty/ANGLE/src/compiler.gni:
* Source/ThirdParty/ANGLE/src/compiler/translator/hlsl/TranslatorHLSL.cpp:
* Source/ThirdParty/ANGLE/src/compiler/translator/msl/TranslatorMSL.cpp:
(sh::TranslatorMSL::translateImpl):
* 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/AddDefaultReturnStatements.cpp:
 Renamed from 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/hlsl/AddDefaultReturnStatements.cpp.
* 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/AddDefaultReturnStatements.h:
 Renamed from 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/hlsl/AddDefaultReturnStatements.h.
* Source/ThirdParty/ANGLE/src/tests/gl_tests/GLSLTest.cpp:

Originally-landed-as: 305413.214@safari-7624-branch (c23dbbde0701). 
rdar://173969068
Canonical link: https://commits.webkit.org/312446@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to