[llvm] [SandboxVectorizer][NFCI] Fix use of possibly-uninitialized scalar. (PR #122201)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 15:16:23 PST 2025


================
@@ -686,7 +686,7 @@ void Context::runMoveInstrCallbacks(Instruction *I, const BBIterator &WhereIt) {
 Context::CallbackID Context::registerEraseInstrCallback(EraseInstrCallback CB) {
   assert(EraseInstrCallbacks.size() <= MaxRegisteredCallbacks &&
          "EraseInstrCallbacks size limit exceeded");
-  CallbackID ID = NextCallbackID++;
+  CallbackID ID{NextCallbackID++};
----------------
vporpo wrote:

We should probably have a check here that `NextCallbackID` is not equal to the reserved value, with something like:
```
assert(NextCallbackID != CallbackID::UninitVal && "Matches the reserved value!");
```

https://github.com/llvm/llvm-project/pull/122201


More information about the llvm-commits mailing list