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

al_build_menu segfault #615

Closed
SiegeLord opened this issue Apr 10, 2016 · 2 comments
Closed

al_build_menu segfault #615

SiegeLord opened this issue Apr 10, 2016 · 2 comments

Comments

@SiegeLord
Copy link
Member

See https://www.allegro.cc/forums/thread/616194 for details.

It looks like the recursion isn't coded quite correctly, the function always returns 1 past the last pointer read, which causes the outer loop to read 1 past the final entry for nested menus.

@SiegeLord
Copy link
Member Author

This is a PEBCAK, although it's sad that we have to segfault. You always need two trailing ALLEGRO_END_OF_MENU if you have nested menus as per the documentation.

@fatcerberus
Copy link
Contributor

This makes perfect sense to me. One ALLEGRO_END_OF_MENU for each nesting level, just like you need to match brackets in code. If we could fix the segfault it would be great, but I guess if that's too difficult it's not worth going to the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants