]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Handle any exceptions while constructing compiler elements
authorMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 05:23:21 +0000 (15:23 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 18 Sep 2017 03:29:34 +0000 (13:29 +1000)
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.

src/hs.cpp

index 9305c9249d17ce7a4ec6d0d69e383596cbd404e2..c2143fe31eed1c388b095209c65e792484df8e7e 100644 (file)
@@ -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 {