Protected calls to and returns from some C library functions zero out argument/return registers

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-13315
    • C29_1.0.0.LTS
    • Hide
      C29_1.0.1.LTS*
      C29_2.0.0.STS*
      Show
      C29_1.0.1.LTS* C29_2.0.0.STS*
    • default

      Calls to the following functions may not work correctly when made using protected calls:

      • memcpy
        • Calls to this function may be generated by the compiler
      • setjmp/longjmp
      • strcmp

      As a workaround, provide a local C implementation of these functions and call them instead. This may impact performance and will impact code size.

       

      void *memcpy(void *dest, const void *src, size_t count ) {
        for (size_t i = 0; i < count; i++)
          dest[i] = src[i];
        return dest;
      }
      int strcmp(const char *lhs, const char *rhs) {
        int c1, res;
        for (;;) {
          c1  = (unsigned char)*string1++;
          res = c1 - (unsigned char)*string2++;
          if (c1 == 0 || res != 0) break;
      }
      

       

       

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

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5105 - Protected calls to and returns from...
                SYNCHRONIZED
                • Last Sync Date: