Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10163

Compiler does not account for wraparound when different increment type added to signed int

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-8440
    • Hide
      MSP430_20.12.0.STS
      PRU_2.4.0*
      C2000_20.12.0.STS
      C7000_2.0.0.STS*
      Show
      MSP430_20.12.0.STS PRU_2.4.0* C2000_20.12.0.STS C7000_2.0.0.STS*
    • Hide
      MSP430_21.6.0.LTS
      PRU_2.4.0*
      C2000_21.6.0.LTS
      C7000_2.0.0.STS*
      Show
      MSP430_21.6.0.LTS PRU_2.4.0* C2000_21.6.0.LTS C7000_2.0.0.STS*
    • default
    • Hide
      Cast the subexpression computed with the UL literal to a signed int:

          error += (signed int)(((3686400UL)/8)/(4096));
      Show
      Cast the subexpression computed with the UL literal to a signed int:     error += (signed int)(((3686400UL)/8)/(4096));

      In the case that a larger unsigned increment type was added to a signed int, a compiler optimization did not account for possible wraparound resulting in a negative value and erroneously assumed the signed int variable was never negative.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: