mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
Fixed use of char array for string in blifparse error handling
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
b210e9d293
commit
93efbd5d15
|
@ -85,7 +85,7 @@ void parse_blif(RTLIL::Design *design, std::istream &f, std::string dff_name, bo
|
||||||
RTLIL::Cell *sopcell = NULL;
|
RTLIL::Cell *sopcell = NULL;
|
||||||
RTLIL::Cell *lastcell = nullptr;
|
RTLIL::Cell *lastcell = nullptr;
|
||||||
RTLIL::State lut_default_state = RTLIL::State::Sx;
|
RTLIL::State lut_default_state = RTLIL::State::Sx;
|
||||||
char err_reason[80];
|
std::string err_reason;
|
||||||
int blif_maxnum = 0, sopmode = -1;
|
int blif_maxnum = 0, sopmode = -1;
|
||||||
|
|
||||||
auto blif_wire = [&](const std::string &wire_name) -> Wire*
|
auto blif_wire = [&](const std::string &wire_name) -> Wire*
|
||||||
|
@ -276,7 +276,7 @@ void parse_blif(RTLIL::Design *design, std::istream &f, std::string dff_name, bo
|
||||||
|
|
||||||
if(lastcell == nullptr || module == nullptr)
|
if(lastcell == nullptr || module == nullptr)
|
||||||
{
|
{
|
||||||
snprintf(err_reason, sizeof(err_reason), "No primative object to attach .cname %s.", p);
|
err_reason = stringf("No primative object to attach .cname %s.", p);
|
||||||
goto error_with_reason;
|
goto error_with_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,13 +302,13 @@ void parse_blif(RTLIL::Design *design, std::istream &f, std::string dff_name, bo
|
||||||
}
|
}
|
||||||
if (!strcmp(cmd, ".attr")) {
|
if (!strcmp(cmd, ".attr")) {
|
||||||
if (obj_attributes == nullptr) {
|
if (obj_attributes == nullptr) {
|
||||||
snprintf(err_reason, sizeof(err_reason), "No object to attach .attr too.");
|
err_reason = stringf("No object to attach .attr too.");
|
||||||
goto error_with_reason;
|
goto error_with_reason;
|
||||||
}
|
}
|
||||||
(*obj_attributes)[id_n] = const_v;
|
(*obj_attributes)[id_n] = const_v;
|
||||||
} else {
|
} else {
|
||||||
if (obj_parameters == nullptr) {
|
if (obj_parameters == nullptr) {
|
||||||
snprintf(err_reason, sizeof(err_reason), "No object to attach .param too.");
|
err_reason = stringf("No object to attach .param too.");
|
||||||
goto error_with_reason;
|
goto error_with_reason;
|
||||||
}
|
}
|
||||||
(*obj_parameters)[id_n] = const_v;
|
(*obj_parameters)[id_n] = const_v;
|
||||||
|
@ -575,7 +575,7 @@ void parse_blif(RTLIL::Design *design, std::istream &f, std::string dff_name, bo
|
||||||
error:
|
error:
|
||||||
log_error("Syntax error in line %d!\n", line_count);
|
log_error("Syntax error in line %d!\n", line_count);
|
||||||
error_with_reason:
|
error_with_reason:
|
||||||
log_error("Syntax error in line %d: %s\n", line_count, err_reason);
|
log_error("Syntax error in line %d: %s\n", line_count, err_reason.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
struct BlifFrontend : public Frontend {
|
struct BlifFrontend : public Frontend {
|
||||||
|
|
Loading…
Reference in a new issue