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

Use of stdarg.h va_start macro causes a write to the wrong local variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-4634
    • Hide
      C6000_8.2.0
       C6000_8.1.0B1
       C2000_16.9.0.LTS
      Show
      C6000_8.2.0  C6000_8.1.0B1  C2000_16.9.0.LTS
    • Hide
      C6000_8.1.8
       C2000_16.9.9.LTS
       ARM_16.9.9.LTS
      Show
      C6000_8.1.8  C2000_16.9.9.LTS  ARM_16.9.9.LTS
    • Hide
      The test case for codegen-4634 has both a va_list declaration and a use of va_start. If the two are placed together, by moving the va_list declaration into the scope with the va_start, the problem does not occur.

      The general workaround is to ensure an expression appears before the first nested scope. Exactly how to do that will depend on the situation.
      Show
      The test case for codegen-4634 has both a va_list declaration and a use of va_start. If the two are placed together, by moving the va_list declaration into the scope with the va_start, the problem does not occur. The general workaround is to ensure an expression appears before the first nested scope. Exactly how to do that will depend on the situation.
    • Hide
      A function with a nested scope that declares local variables and appears before any expressions in the function, and also declares top-level locals after that, may mishandle the local variables in a way that acts as though some share a location though they're supposed to be distinct. I.e.,

        int test(int arg, ...)
        {
          { int a = 0; }
          int b;

      may mishandle a, b, arg, or any extra arguments.

      Known cases all involve the ellipsis (...) parameter, but it is not known if that is also a necessary prerequisite.
      Show
      A function with a nested scope that declares local variables and appears before any expressions in the function, and also declares top-level locals after that, may mishandle the local variables in a way that acts as though some share a location though they're supposed to be distinct. I.e.,   int test(int arg, ...)   {     { int a = 0; }     int b; may mishandle a, b, arg, or any extra arguments. Known cases all involve the ellipsis (...) parameter, but it is not known if that is also a necessary prerequisite.

      Use of stdarg.h va_start macro causes a write to the wrong local variable

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

              Created:
              Updated:
              Resolved: