Changeset 4522


Ignore:
Timestamp:
Feb 27, 2015, 8:08:05 AM (4 years ago)
Author:
cameron
Message:

Catch std::runtime_error and report; sanitize only on Linux

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r4516 r4522  
    251251
    252252SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
    253 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -fsanitize=address")
     253IF (${CMAKE_SYSTEM} MATCHES "Linux")
     254    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -fsanitize=address")
     255ENDIF()
    254256
    255257add_test(
  • icGREP/icgrep-devel/icgrep/compiler.cpp

    r4521 r4522  
    167167    install_property_PropList_fn_ptrs(pablo_compiler);
    168168
    169     CompiledPabloFunction retVal = pablo_compiler.compile(main);
    170 
    171     RE::release_memory();
    172     PabloAST::release_memory();
    173 
    174     return retVal;
     169    try {
     170        CompiledPabloFunction retVal = pablo_compiler.compile(main);
     171        RE::release_memory();
     172        PabloAST::release_memory();
     173       
     174        return retVal;
     175    }
     176    catch (std::runtime_error e)
     177    {
     178        std::cerr << "Runtime error: " << e.what() << std::endl;
     179        exit(1);
     180    }
    175181}
    176182
Note: See TracChangeset for help on using the changeset viewer.