Skip to content

Commit

Permalink
Merge pull request #1811 from riscv-software-src/fix-1810
Browse files Browse the repository at this point in the history
Validate Zvl ISA string correctly
  • Loading branch information
aswaterman authored Sep 20, 2024
2 parents 52aff02 + 6b74bd6 commit 19fdd76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion disasm/isa_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ isa_parser_t::isa_parser_t(const char* str, const char *priv)
} catch (std::logic_error& e) {
new_vlen = 0;
}
if ((new_vlen & (new_vlen - 1)) != 0 || new_vlen < 32)
if ((new_vlen & (new_vlen - 1)) != 0 || new_vlen < 32 || ext_str.back() != 'b')
bad_isa_string(str, ("Invalid Zvl string: " + ext_str).c_str());
vlen = std::max(vlen, new_vlen);
} else if (ext_str.substr(0, 3) == "zve") {
Expand Down

0 comments on commit 19fdd76

Please sign in to comment.