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 trying to enumerate Top Level Headers #47

Closed
apriori opened this issue Jun 2, 2014 · 3 comments
Closed

Crash when trying to enumerate Top Level Headers #47

apriori opened this issue Jun 2, 2014 · 3 comments

Comments

@apriori
Copy link

apriori commented Jun 2, 2014

The linked code segfaults for even the utmost trivial C++ code (e.g. int main function, returning 0)

https://gist.github.com/apriori/0527c9d03b03fc5f5e10

@ghorn
Copy link
Contributor

ghorn commented Jun 3, 2014

What operating system are you using? Which version of LibClang?

@sethfowler
Copy link
Collaborator

@apriori, thanks for letting us know about the problem. I'll investigate when I get a chance.

It would not surprise me at all to learn that there's a bug in the module-related bindings, since I've never tested them. There have been cases before where we didn't realize a function could return null, leading to segfaults when it does and we try to dereference the resulting pointer.

@sethfowler
Copy link
Collaborator

@apriori Looks like it was a simple off-by-one error.

Your gist works fine for me now, so I've closed this issue. Please reopen if you're still having trouble.

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

No branches or pull requests

3 participants