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

Read of array element, before memcpy() overwrites it, may be out of order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-551
    • SDSCM00045381
    • C6000_7.4.0B1
    • C6000_7.4.3
    • Hide
      The test case is using memcpy() to implement a shift register in an
      array. More efficient, and also avoiding the problem, is to use a
      circular-queue arrangement: instead of having the head of the queue
      always be x[0] and implementing a pop by shifting the whole array, have
      the head be x[head] and implement the pop as head=(head+1)%arraysize.

      Or use -o1 or -o0.
      Show
      The test case is using memcpy() to implement a shift register in an array. More efficient, and also avoiding the problem, is to use a circular-queue arrangement: instead of having the head of the queue always be x[0] and implementing a pop by shifting the whole array, have the head be x[head] and implement the pop as head=(head+1)%arraysize. Or use -o1 or -o0.

      Read of array element, before memcpy() overwrites it, may be out of order

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

              Created:
              Updated:
              Resolved: