================
@@ -19690,6 +19690,35 @@ class VoidExprEvaluator
// The argument is not evaluated!
return true;
+ case Builtin::BI__builtin_assume_dereferenceable: {
+ assert(E->getType()->isVoidType());
+ assert(E->getNumArgs() == 2);
+
+ APSInt ReqSizeVal;
+ if (!::EvaluateInteger(E->getArg(1), ReqSizeVal, Info))
+ return false;
+ LValue Pointer;
+ if (!EvaluatePointer(E->getArg(0), Pointer, Info))
+ return false;
+ if (Pointer.Designator.Invalid)
+ return false;
+ if (Pointer.isNullPointer())
+ return false;
+
+ uint64_t ReqSize = ReqSizeVal.getZExtValue();
+ if (ReqSize < 1)
+ return false;
----------------
tbaederr wrote:
Shouldn't this return true?
https://github.com/llvm/llvm-project/pull/169869
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits