llvm 21

Open wide: Inspecting LLVM 21 with static analysis

It has been over a year since the last check of the LLVM project with PVS-Studio, and in that time, two releases have come out. So, it's a good time to get back and analyze the fresh LLVM 21.

Open wide: Inspecting LLVM 21 with static analysis

by Nikita Terentev

From the article:

As we can see, error logging will never be executed, and, moreover, execution will always continue with potentially incorrect behavior. Here's what git blame reports: the code celebrates its tenth anniversary in November. One might think its meaning had changed over time. But no, history confirms that Defs has always been DenseMap, and its count function only returned 0 or 1 back then. If we search for other similar checks, we see that the count result is used as a binary value everywhere.