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

VS Exception handling only in C++ code #1521

Merged
merged 3 commits into from
Sep 6, 2015
Merged

VS Exception handling only in C++ code #1521

merged 3 commits into from
Sep 6, 2015

Conversation

saper
Copy link
Member

@saper saper commented Sep 2, 2015

Catch exceptions only in C++ code,
extern "C" functions should (ideally) be exception-free.

While here, move functions shared between sass_interface.cpp and sass_context.cpp into util.cpp

Fixes: #1508

if (arr == 0) throw(std::bad_alloc());
char** arr = (char**) calloc(num + 1, sizeof(char*));
if (arr == 0)
return;
Copy link
Contributor

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?

Copy link
Member Author

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.

@mgreter
Copy link
Contributor

mgreter commented Sep 4, 2015

Can you resolve the conflicts? Otherwise LGTM!

@saper
Copy link
Member Author

saper commented Sep 4, 2015

Solved in a private branch, will push in the morning CEST

Catch exceptions only in C++ code,
extern "C" functions should be exception-free.

Fixes: sass#1508
This partially reverts 7d19487
xzyfer added a commit that referenced this pull request Sep 6, 2015
VS Exception handling only in C++ code
@xzyfer xzyfer merged commit 3ade3d0 into sass:master Sep 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants