diff options
author | Geoffrey Keating <geoffk@geoffk.org> | 2001-07-01 02:48:46 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@geoffk.org> | 2001-07-01 02:48:46 +0000 |
commit | 17f0ac8499203b80006e779474947a908285d2ce (patch) | |
tree | 7c171f4f612729a7c945078e41b3f62991af2b77 /opcodes/cgen-ibld.in | |
parent | b9f83eaa836b10b3d5b2ac04f1a4bbf2284b76eb (diff) | |
download | gdb-17f0ac8499203b80006e779474947a908285d2ce.zip gdb-17f0ac8499203b80006e779474947a908285d2ce.tar.gz gdb-17f0ac8499203b80006e779474947a908285d2ce.tar.bz2 |
* cgen-ibld.in (insert_normal): Support CGEN_IFLD_SIGN_OPT.
Diffstat (limited to 'opcodes/cgen-ibld.in')
-rw-r--r-- | opcodes/cgen-ibld.in | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/opcodes/cgen-ibld.in b/opcodes/cgen-ibld.in index ca2f1e5..0ca4200 100644 --- a/opcodes/cgen-ibld.in +++ b/opcodes/cgen-ibld.in @@ -145,7 +145,22 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length, } /* Ensure VALUE will fit. */ - if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) + if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) + { + long minval = - (1L << (length - 1)); + unsigned long maxval = mask; + + if ((value > 0 && (unsigned long) value > maxval) + || value < minval) + { + /* xgettext:c-format */ + sprintf (errbuf, + _("operand out of range (%ld not between %ld and %lu)"), + value, minval, maxval); + return errbuf; + } + } + else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) { unsigned long maxval = mask; |