diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-07-27 12:04:12 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-07-27 12:05:50 +0200 |
commit | d878fcbdc76f4b612ba8578213f73f27585fc792 (patch) | |
tree | 6a803cd2191455691c9fe2054348c7c896303902 /kernel | |
parent | 7661ded8ddf85e8cd80ccce0bec211d9bf46e56b (diff) | |
download | yosys-d878fcbdc76f4b612ba8578213f73f27585fc792.tar.gz yosys-d878fcbdc76f4b612ba8578213f73f27585fc792.tar.bz2 yosys-d878fcbdc76f4b612ba8578213f73f27585fc792.zip |
Added log_cmd_error_expection
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/driver.cc | 6 | ||||
-rw-r--r-- | kernel/log.cc | 2 | ||||
-rw-r--r-- | kernel/log.h | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc index 7a1c7ed16..380315e7c 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -141,9 +141,9 @@ static void run_frontend(std::string filename, std::string command, RTLIL::Desig Pass::call(design, command); } } - catch (...) { + catch (log_cmd_error_expection) { Frontend::current_script_file = backup_script_file; - std::rethrow_exception(std::current_exception()); + throw log_cmd_error_expection(); } Frontend::current_script_file = backup_script_file; @@ -329,7 +329,7 @@ static void shell(RTLIL::Design *design) try { assert(design->selection_stack.size() == 1); Pass::call(design, command); - } catch (int) { + } catch (log_cmd_error_expection) { while (design->selection_stack.size() > 1) design->selection_stack.pop_back(); log_reset_stack(); diff --git a/kernel/log.cc b/kernel/log.cc index 63a0a84dd..b8a47e1cf 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -160,7 +160,7 @@ void log_cmd_error(const char *format, ...) log("ERROR: "); logv(format, ap); log_flush(); - throw 0; + throw log_cmd_error_expection(); } logv_error(format, ap); diff --git a/kernel/log.h b/kernel/log.h index 1658800dd..abfb810f7 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -34,6 +34,8 @@ #define S__LINE__sub1(x) S__LINE__sub2(x) #define S__LINE__ S__LINE__sub1(__LINE__) +struct log_cmd_error_expection { }; + extern std::vector<FILE*> log_files; extern FILE *log_errfile; extern bool log_time; |