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

Avoid dereferencing nullptr in GetStackItemRef::baseRef #3315

Merged
merged 1 commit into from
May 12, 2022

Conversation

vlstill
Copy link
Contributor

@vlstill vlstill commented May 12, 2022

For things like pkg.lookahead<some_struct_t>().foo[4] the base_ in this code does not point to a header and therefore calls to baseRef cause SIGSEGV. Instead I propese it returns nullptr which can be handled by the callee if needed.

@vlstill vlstill merged commit 0f7104e into main May 12, 2022
@vlstill vlstill deleted the vstill/stack-baseRef branch May 12, 2022 19:22
github-sajan pushed a commit to github-sajan/p4c that referenced this pull request May 26, 2022
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