Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with gcc 14; Fix evaluation of $left, $right, $high, $low #1081

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions templates/ExprEval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2568,12 +2568,12 @@ any *ExprEval::hierarchicalSelector(std::vector<std::string> &select_path,
}
tmp->Ranges(tmpR);
return tmp;
}
}
} else if (const array_typespec *ltps =
any_cast<const array_typespec *>(object)) {
if (const ref_typespec *rt = ltps->Elem_typespec()) {
return (typespec *)rt->Actual_typespec();
}
}
} else if (const packed_array_typespec *ltps =
any_cast<const packed_array_typespec *>(object)) {
if (const ref_typespec *rt = ltps->Elem_typespec()) {
Expand Down Expand Up @@ -4049,17 +4049,17 @@ expr *ExprEval::reduceExpr(const any *result, bool &invalidValue,
int64_t lrv = eval.get_value(invalidValue, lr);
rr = reduceExpr(rr, invalidValue, inst, pexpr, muteError);
int64_t rrv = eval.get_value(invalidValue, rr);
if (name == "left") {
if (name == "$left") {
return lr;
} else if (name == "right") {
} else if (name == "$right") {
return rr;
} else if (name == "high") {
} else if (name == "$high") {
if (lrv > rrv) {
return lr;
} else {
return rr;
}
} else if (name == "low") {
} else if (name == "$low") {
if (lrv > rrv) {
return rr;
} else {
Expand Down
1 change: 1 addition & 0 deletions templates/vpi_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>

static bool showIDs = false;
static constexpr int32_t kLevelIndent = 2;
Expand Down
Loading