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

Prevents shader crash if passing invalid struct to the return statement #46272

Merged
merged 1 commit into from
Feb 21, 2021

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Feb 21, 2021

Fix crash eg:

shader_type spatial;

struct A {
	float a;
};

struct B {
	A t;
};

A foo() {
	B b;
	return b; // invalid-type - CRASH
}

void fragment() {
	foo();
}

@Chaosus Chaosus requested a review from a team as a code owner February 21, 2021 04:52
@Chaosus Chaosus added this to the 4.0 milestone Feb 21, 2021
@akien-mga akien-mga merged commit 3bb628d into godotengine:master Feb 21, 2021
@akien-mga
Copy link
Member

Thanks!

@Chaosus Chaosus deleted the shader_fix_struct_crash branch February 21, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants