-
Notifications
You must be signed in to change notification settings - Fork 465
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
VS Exception handling only in C++ code #1521
Conversation
if (arr == 0) throw(std::bad_alloc()); | ||
char** arr = (char**) calloc(num + 1, sizeof(char*)); | ||
if (arr == 0) | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe set *array
to NULL
as an equivalent to the exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, my mistake. Even more, let's make it return the (char **)
pointer for easier error checking.
* See http://stackoverflow.com/a/13841791/863980. * Also fixes a case where non-throw exception was throwing in sass_context.cpp.
Can you resolve the conflicts? Otherwise LGTM! |
Solved in a private branch, will push in the morning CEST |
VS Exception handling only in C++ code
Catch exceptions only in C++ code,
extern "C" functions should (ideally) be exception-free.
While here, move functions shared between
sass_interface.cpp
andsass_context.cpp
intoutil.cpp
Fixes: #1508