diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index c3d019c03a6..044cc63d09e 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1536,13 +1536,9 @@ riscv_parsing_subset_version (const char *p, { np = *(p + 1); + /* Might be beginning of `p` extension. */ if (!ISDIGIT (np)) - { - /* Might be beginning of `p` extension. */ - *major_version = version; - *minor_version = 0; - return p; - } + break; *major_version = version; major_p = false;