dotnet / dotnet/wpf

Dead assignment in WpfGfx handle_errors_and_transform_hresult

Open
#2,651 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: N/A
* Windows version: N/A
* Does the bug reproduce also in WPF for .NET Framework 4.8?: No
* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No
* Security issues and bugs should be reported privately, learn more via our [responsible disclosure guidelines](https://github.com/dotnet/wpf/blob/master/README.md#reporting-security-issues-and-security-bugs).



**Problem description:**

The assignment to retval in handle_errors_and_transform_hresult, defined in shader_compiler_dx9.hpp and shader_compiler_xm.hpp, is unused. As a result, this function returns the error code passed to it in all cases, instead of changing some codes to WGXERR_SHADER_COMPILE_FAILED, as intended.

The correct solution is probably to return retval as intended, but I don't know if this will have any unintended consequences.

**Actual behavior:**

Compilation with mingw warns of an unused assignment to retval.

**Expected behavior:**

No compiler warnings.

**Minimal repro:**

I'm attempting to compile with mingw and a lot of changes were required to get this far. As such, I do not have a small way to test this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.