File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
2020# - TE_BUILD_TEST_RUNNER to toggle running the tests
2121
2222option (TE_BUILD_TEST_RUNNER "Build test runner" ON )
23+ option (USE_ADDRESS_SANITIZE "Use ASAN" ON )
2324
2425project (TETestRunner)
2526
Original file line number Diff line number Diff line change @@ -2451,10 +2451,20 @@ void te_parser::optimize(te_expr* texp)
24512451 }
24522452 if (known)
24532453 {
2454- const auto value = te_eval (texp);
2455- te_free_parameters (texp);
2456- texp->m_type = TE_DEFAULT;
2457- texp->m_value = value;
2454+ try
2455+ {
2456+ const auto value = te_eval (texp);
2457+ te_free_parameters (texp);
2458+ texp->m_type = TE_DEFAULT;
2459+ texp->m_value = value;
2460+ }
2461+ catch (const std::exception& exp)
2462+ {
2463+ te_free_parameters (texp);
2464+ texp->m_type = TE_DEFAULT;
2465+ texp->m_value = te_nan;
2466+ throw exp;
2467+ }
24582468 }
24592469 }
24602470 }
You can’t perform that action at this time.
0 commit comments