Skip to content

Conversation

@aleksander-mendoza
Copy link

Hey, I think you might like this improvement. At least I'd really love this being added, because without it the API is not safe and can crash when someone attempts to build sub-buffer of sub-buffer

@c0gent
Copy link
Member

c0gent commented Feb 21, 2023

Apologies for not responding to this sooner.

It's been a while since I've looked at this code. Any chance you could explain your changes?

After this much time you've probably forgotten too. Either way no worries and thanks anyway :)

@aleksander-mendoza
Copy link
Author

aleksander-mendoza commented Feb 22, 2023

This code caused crashes. It's been long time and I don't have the code that could reproduce this anymore but essentially if you try to make subbuffer of a subbuffer then core::create_sub_buffer calls some illegal operation and crashes (tried on OS X). My fix checks for this scenario and runs the correct sequence of functions. Instead of making subbuffer of subbuffer it creates a subbufer of the parent buffer with the appropriate offset being sum of parent offset and new subbufer offset.

@c0gent
Copy link
Member

c0gent commented Feb 25, 2023

Ok thanks much.

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 this pull request may close these issues.

3 participants