[PATCH] D57948: [Sema] Fix a regression introduced in "[AST][Sema] Remove CallExpr::setNumArgs"
Bruno Ricci via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 8 05:59:05 PST 2019
riccibruno created this revision.
riccibruno added a reviewer: aaron.ballman.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.
D54902 <https://reviews.llvm.org/D54902> removed `CallExpr::setNumArgs` in preparation of tail-allocating the arguments of `CallExpr`. It did this by allocating storage for `max(number of arguments, number of parameters in the prototype)`. The temporarily nulled arguments however causes issues in `BuildResolvedCallExpr` when typo correction is done just after the creation of the call expression.
This was unfortunately missed by the tests /:
To fix this, delay setting the number of arguments to `max(number of arguments, number of parameters in the prototype)` until we are ready for it. It would be nice to have this encapsulated in `CallExpr` but this is the best I can come up with under the constraint that we cannot add anything the `CallExpr`.
Fixes PR40286. This should probably be cherry-picked into the release branch.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7792 bytes
Desc: not available
More information about the cfe-commits