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

Incorrect vector pointer comparison results in host emulation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-8895
    • C7000_1.4.2.LTS
    • Hide
      C7000_1.4.3.LTS*
      C7000_2.0.0.STS*
      Show
      C7000_1.4.3.LTS* C7000_2.0.0.STS*
    • default
    • Hide
      If the vector pointers are converted to scalar pointers in source code before comparison, results will be correct. For example, "((void*)ptr1 == (void*)ptr1)" instead of "(ptr1 == ptr1)".

      Alternatively, the problem may be fixed in the vector.h header of the installation, located in host_emulation/include/C7100/ti_he_impl/. Any comparison operator in class t_ptr needs a dereference (*) on "this". For t_ptr::operator==, the result would be:

      bool operator==(const t_ptr<OTYPE> &other) const
      {
          // return ((const void*)this) == ((const void*)other);
          return ((const void*)*this) == ((const void*)other);
      }
      Show
      If the vector pointers are converted to scalar pointers in source code before comparison, results will be correct. For example, "((void*)ptr1 == (void*)ptr1)" instead of "(ptr1 == ptr1)". Alternatively, the problem may be fixed in the vector.h header of the installation, located in host_emulation/include/C7100/ti_he_impl/. Any comparison operator in class t_ptr needs a dereference (*) on "this". For t_ptr::operator==, the result would be: bool operator==(const t_ptr<OTYPE> &other) const {     // return ((const void*)this) == ((const void*)other);     return ((const void*)*this) == ((const void*)other); }

      Pointer comparisons in host emulation return incorrect results due to comparing the address of the vector pointer object to the buffer pointed to by the other vector pointer object.

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

              Created:
              Updated:
              Resolved: