3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-18 11:58:32 +00:00

Merge pull request #64 from alaindargelas/remove_try_catch_masking_stack_trace

Remove try/catch block that prevents proper stack trace unrolling
This commit is contained in:
alaindargelas 2025-03-13 14:25:55 -07:00 committed by GitHub
commit f79f402dbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1109,34 +1109,28 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
FILE *backup_script_file = Frontend::current_script_file; FILE *backup_script_file = Frontend::current_script_file;
Frontend::current_script_file = f; Frontend::current_script_file = f;
try { std::string command;
std::string command; while (fgetline(f, command)) {
while (fgetline(f, command)) { while (!command.empty() && command[command.size() - 1] == '\\') {
while (!command.empty() && command[command.size()-1] == '\\') { std::string next_line;
std::string next_line; if (!fgetline(f, next_line))
if (!fgetline(f, next_line)) break;
break; command.resize(command.size() - 1);
command.resize(command.size()-1); command += next_line;
command += next_line;
}
handle_label(command, from_to_active, run_from, run_to);
if (from_to_active) {
Pass::call(design, command);
design->check();
}
} }
handle_label(command, from_to_active, run_from, run_to);
if (!command.empty()) { if (from_to_active) {
handle_label(command, from_to_active, run_from, run_to); Pass::call(design, command);
if (from_to_active) { design->check();
Pass::call(design, command);
design->check();
}
} }
} }
catch (...) {
Frontend::current_script_file = backup_script_file; if (!command.empty()) {
throw; handle_label(command, from_to_active, run_from, run_to);
if (from_to_active) {
Pass::call(design, command);
design->check();
}
} }
Frontend::current_script_file = backup_script_file; Frontend::current_script_file = backup_script_file;