ubsan: tilepro: signed integer overflow
[deliverable/binutils-gdb.git] / opcodes / tilepro-opc.c
index 6449945aa4f4388d5cb973452030b180ccee5e62..dbe0605e0c6e4d9960cc473758a5588a972961e0 100644 (file)
@@ -10215,7 +10215,7 @@ parse_insn_tilepro (tilepro_bundle_bits bits,
        {
          const struct tilepro_operand *op =
            &tilepro_operands[opc->operands[pipe][i]];
-         int opval = op->extract (bits);
+         unsigned int opval = op->extract (bits);
 
          if (op->is_signed)
            {
@@ -10226,10 +10226,7 @@ parse_insn_tilepro (tilepro_bundle_bits bits,
 
          /* Adjust PC-relative scaled branch offsets.  */
          if (op->type == TILEPRO_OP_TYPE_ADDRESS)
-           {
-             opval *= TILEPRO_BUNDLE_SIZE_IN_BYTES;
-             opval += (int)pc;
-           }
+           opval = opval * TILEPRO_BUNDLE_SIZE_IN_BYTES + pc;
 
          /* Record the final value.  */
          d->operands[i] = op;
This page took 0.023419 seconds and 4 git commands to generate.