the C rules say memcpy can't accept a null pointer.
This should fix a test failure with the ubsan buildbots.
bool IsNullPtr) {
MutableArrayRef<APValue::LValuePathEntry> InternalPath =
setLValueUninit(B, O, Path.size(), IsOnePastTheEnd, IsNullPtr);
- memcpy(InternalPath.data(), Path.data(),
- Path.size() * sizeof(LValuePathEntry));
+ if (Path.size()) {
+ memcpy(InternalPath.data(), Path.data(),
+ Path.size() * sizeof(LValuePathEntry));
+ }
}
void APValue::setUnion(const FieldDecl *Field, const APValue &Value) {