diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-01-29 16:59:35 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-01-29 16:59:35 -0800 |
commit | 476677efe5f2b80704bc6067100ad697bd4a21f6 (patch) | |
tree | f964cecba302c7abe7214e08e795ce7bee9dca0b /binutils | |
parent | 06c957aba75025d8da554fe6b6402fb631a93e77 (diff) | |
download | riscv-gnu-toolchain-476677efe5f2b80704bc6067100ad697bd4a21f6.zip riscv-gnu-toolchain-476677efe5f2b80704bc6067100ad697bd4a21f6.tar.gz riscv-gnu-toolchain-476677efe5f2b80704bc6067100ad697bd4a21f6.tar.bz2 |
gas: print better error message for bad constants
This resolves #118.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/gas/config/tc-riscv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/binutils/gas/config/tc-riscv.c b/binutils/gas/config/tc-riscv.c index f391d4c..90d3c4b 100644 --- a/binutils/gas/config/tc-riscv.c +++ b/binutils/gas/config/tc-riscv.c @@ -881,7 +881,11 @@ load_const (int reg, expressionS *ep) lower.X_add_number = (int32_t) ep->X_add_number << (32-shift) >> (32-shift); upper.X_add_number -= lower.X_add_number; - gas_assert (ep->X_op == O_constant); + if (ep->X_op != O_constant) + { + as_bad (_("unsupported large constant")); + return; + } if (xlen > 32 && !IS_SEXT_32BIT_NUM(ep->X_add_number)) { |