From: Matthew Barr Date: Mon, 21 Aug 2017 05:23:21 +0000 (+1000) Subject: Handle any exceptions while constructing compiler elements X-Git-Tag: v4.6.0^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b63a95f016d462ba01a2acb615ad65b3c7f1c86;p=thirdparty%2Fvectorscan.git Handle any exceptions while constructing compiler elements Specifically, NG has a Rose which has a LeftEng which has a depth, which can throw an error on construction. If we put these in the try-catch we don't have to worry so much in future. --- diff --git a/src/hs.cpp b/src/hs.cpp index 9305c924..c2143fe3 100644 --- a/src/hs.cpp +++ b/src/hs.cpp @@ -227,10 +227,10 @@ hs_compile_multi_int(const char *const *expressions, const unsigned *flags, target_t target_info = platform ? target_t(*platform) : get_current_target(); - CompileContext cc(isStreaming, isVectored, target_info, g); - NG ng(cc, elements, somPrecision); - try { + CompileContext cc(isStreaming, isVectored, target_info, g); + NG ng(cc, elements, somPrecision); + for (unsigned int i = 0; i < elements; i++) { // Add this expression to the compiler try {