-
Notifications
You must be signed in to change notification settings - Fork 293
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
Segfault on mpca_lang instanciation #8
Comments
Hey, You have a mismatched name. You declare a parser called Because variable arguments in C suck, unfortunately I don't know if there is a way to detect this and give an error rather than crash but I'll check it out, and if not I'll make it clearer in the documentation. Many Thanks, Dan |
Oh, you're perfectly right. My bad. Now I realize it happened to me a lot while working on lipstick, the lisp resulting from buildyourownlisp :) Anyway, I think letting the program segfault rather than dropping an error is a bad design decision, as SIGSEV tells the system "hey dude, your program is pretty fucked up, I won't let it run". If you open an issue about it, I'd be glad to participate and help :) Thanks for your help |
You're correct it isn't a very good way to deal with the error. Unfortunately because you can't find our how many variable arguments are passed in by the user, you can't tell if either they've got a naming wrong or there are just more variable arguments to come. I did actually have a solution to this in mind. If you pass in |
Okay. In the newest version you should now get a nice error message if you NULL terminate the list of parsers to |
Hi!
I've been working around the examples in the readme (which by the way are not really up to date), and buildyourownlisp. Updating mpc today lead me to get a segfault on my mpca_lang instanciation.
It seems to be a problem with a NULL pointer manipulation, but don't really have the time to dig in it right now, any clue?
example source
gdb session
The text was updated successfully, but these errors were encountered: