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

Check stk before dereferencing #7033

Closed
wants to merge 3 commits into from
Closed

Check stk before dereferencing #7033

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 9, 2013

This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.

This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
@brson
Copy link
Contributor

brson commented Jun 10, 2013

I believe that stk != NULL is an invariant here - we never ask for a big stack before allocating an initial stack segment. Does this work if you instead remove the if and assert stk != NULL?

Given that a big stack is never requested before allocating an initial
stack segment, having a non-null stk member here is an invariant.
@ghost
Copy link
Author

ghost commented Jun 11, 2013

make check runs without issue. I like the assert much better ^_^

@brson
Copy link
Contributor

brson commented Jun 11, 2013

Thanks!

@ghost
Copy link
Author

ghost commented Jun 11, 2013

facepalm - didn't commit fixing the tabs after I caught it with make check.

bors added a commit that referenced this pull request Jun 11, 2013
This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
@bors bors closed this Jun 11, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 8, 2021
Fix ICE in `missing_panics_doc`

fixes: rust-lang#7033
changelog: Fix ICE in `missing_panics_doc` while searching in a `const` block
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.

2 participants