From 1d6d62a4827d7b67fb6fe8ee62377a3544c67d88 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Fri, 27 Feb 2004 12:33:11 +0000 Subject: [PATCH] * config/tc-s390.c (s390_insn): Correct range check for opcode in .insn pseudo operation. --- gas/ChangeLog | 5 +++++ gas/config/tc-s390.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 10646356504..b8b3d5e58bd 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2004-02-27 Hannes Reinecke + + * config/tc-s390.c (s390_insn): Correct range check for opcode in + .insn pseudo operation. + 2004-02-27 Anil Paranjpe * config/tc-sh.c (get_operand): In case of #Imm, check has been diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index ef51bca4e56..c450eaeea75 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -1614,9 +1614,15 @@ s390_insn (ignore) expression (&exp); if (exp.X_op == O_constant) { - if ( (opformat->oplen == 6 && exp.X_op > 0 && exp.X_op < (1ULL << 48)) - || (opformat->oplen == 4 && exp.X_op > 0 && exp.X_op < (1ULL << 32)) - || (opformat->oplen == 2 && exp.X_op > 0 && exp.X_op < (1ULL << 16))) + if ( ( opformat->oplen == 6 + && exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 48)) + || ( opformat->oplen == 4 + && exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 32)) + || ( opformat->oplen == 2 + && exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 16))) md_number_to_chars (insn, exp.X_add_number, opformat->oplen); else as_bad (_("Invalid .insn format\n")); -- 2.30.2