================
@@ -63,23 +80,27 @@ void setBitsAccordingToFunctionAttributes(const CallType
&Call,
// 'nonnull' attribute's parameters are 1-based and should be adjusted to
// match actual AST parameter/argument indices.
unsigned IdxAST = Idx.getASTIndex();
- if (IdxAST >= AttrNonNull.size())
+ if (IdxAST < Offset)
+ continue;
+ const unsigned IdxArg = IdxAST - Offset;
+ if (IdxArg >= AttrNonNull.size())
continue;
- AttrNonNull.set(IdxAST);
+ AttrNonNull.set(IdxArg);
}
}
}
template <class CallType>
void setBitsAccordingToParameterAttributes(const CallType &Call,
llvm::SmallBitVector &AttrNonNull) {
+ unsigned ArgIdx = 0;
----------------
benedekaibas wrote:
Good catch, thank you! And yes you are right that this is the native index kind
of `CallEvent`, so it should be named consistently.
https://github.com/llvm/llvm-project/pull/221977
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits