Skip to content

Wrap C-ABI, C++ implementation functions in function-level try

Rylie Pavlik requested to merge abi-try into master

In these code pieces, it's possible (though, except in hashset, pretty unlikely) that an exception might be thrown, and we would have leaked that through the nominally-C-ABI, a big problem. This just wraps those functions (in a few files, not all of the cpp files yet - wanted feedback) in a function-try-block that just (possibly prints a message and) returns an error.

(Honest confession: Yes, I did just learn about function-level try and its ability to make C APIs implemented in C++ tidier.)

I can do this to the rest, it's pretty mechanical tbh, but wanted to ask for feedback before going any further.

Merge request reports