https://bugs.llvm.org/show_bug.cgi?id=46885

            Bug ID: 46885
           Summary: Arrays should not be out-of-bound accessed.
                    (llvm-project/llvm/lib/IR/AutoUpgrade.cpp:line 977)
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Arrays should not be out-of-bound accessed. 

The size of array 'Indices' is 4 (Line:975), 'i' ranges from 0 to 'NumElts' and
'NumElts' is lower than 8 (not 4). So in line 977, 'Indices[i]' could result in
out-of-bound access.

(commit: e3546c78cabfbf670391a57766872f0a8e28a423)

llvm-project/llvm/lib/IR/AutoUpgrade.cpp:

   974    if (NumElts < 8) {
   975      int Indices[4];
   976      for (unsigned i = 0; i != NumElts; ++i)
   977        Indices[i] = i;
   978      Mask = Builder.CreateShuffleVector(Mask, Mask,
   979                                         makeArrayRef(Indices, NumElts),
   980                                         "extract");
   981    }
   982  
   983    return Mask;
   984  }

Reported by: Ustchcs Toolsets Bugfinder
(bugfinder-4.5: Arrays should not be out-of-bound accessed.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to