Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crash in EglGetProcAddress on Win32-x86 platform #1688

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

varphone
Copy link
Contributor

@varphone varphone commented Aug 8, 2024

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

Summary

Change the calling convention of the EglGetProcAddress declaration to extern "system" to automatically use the correct calling convention for the platform.

Details

The EglGetProcAddress function uses the stdcall calling convention on the Win32-x86 platform, but it was previously declared as extern "C" in the code.

On the Win32-x86 platform, extern "C" functions use the cdecl calling convention by default.

This mismatch in calling conventions caused a crash.

By changing the declaration to extern "system", the correct calling convention for the platform will be used automatically, preventing the crash.

Testing

  • Verified that the application no longer crashes on the Win32-x86 platform.
  • Ensured that the change does not affect other platforms.

@varphone varphone changed the title Fix EglGetProcAddress crash on win32-x86 Fix crash in EglGetProcAddress on Win32-x86 platform Aug 8, 2024
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a changelog entry for that? should be fine after that.

Change the calling convention of the `EglGetProcAddress` declaration to `extern "system"` to automatically use the correct calling convention for the platform.
@varphone varphone changed the title Fix crash in EglGetProcAddress on Win32-x86 platform Fixed crash in EglGetProcAddress on Win32-x86 platform Aug 10, 2024
@varphone
Copy link
Contributor Author

Could you add a changelog entry for that? should be fine after that.

Already added, please review again.

@MarijnS95
Copy link
Member

In general I'm not a fan of "Fixed crash" or other context-less titles using the word "fix", can we come up with anything more descriptive (i.e. "use the correct calling convention for EglGetProcAddress() on Win32-x86 (optionally: preventing a crash)")? Same for the PR title.

Probably not a requirement to merge though, depending on what Kirill thinks of this.

@varphone varphone requested a review from kchibisov August 20, 2024 01:36
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine after that.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Kirill Chibisov <[email protected]>
@kchibisov kchibisov merged commit d9c2083 into rust-windowing:master Aug 26, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants