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

Crash when union in exceptions.json not previously defined #33

Closed
bbredesen opened this issue Mar 11, 2023 · 0 comments · Fixed by #34
Closed

Crash when union in exceptions.json not previously defined #33

bbredesen opened this issue Mar 11, 2023 · 0 comments · Fixed by #34

Comments

@bbredesen
Copy link
Owner

Found when running against 1.2.177, exceptions.json has a union type defined (VkAccelerationStructureMotionInstanceDataNV), which does not exist in that version of vk.xml.

Crash is here

func ReadUnionExceptionsFromJSON(exceptions gjson.Result, tr TypeRegistry, vr ValueRegistry) {
	exceptions.Get("union").ForEach(func(key, exVal gjson.Result) bool {
		if key.String() == "!comment" {
			return true
		} // Ignore comments

		UpdateUnionTypeFromJSON(key, exVal, tr[key.String()].(*unionType)) // <-- Crash here
                 // This type coercion fail because the map lookup returns nil

		return true
	})
}
bbredesen pushed a commit that referenced this issue Mar 11, 2023
bbredesen added a commit that referenced this issue Mar 28, 2023
logging and nil entry check, fixes #33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant