[test] Fix UBSan failure
UBSan starts complaining about a nullptr destination in memcpy after https://crrev.com/c/2691828. This CL fixes the error by not copying if there is nothing to copy. R=nicohartmann@chromium.org No-Try: true No-Tree-Checks: true Change-Id: I2c941b37d26931d6c2253bc3bb2c0aa659d4cb71 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2690605 Commit-Queue: Nico Hartmann <nicohartmann@chromium.org> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org> Cr-Commit-Position: refs/heads/master@{#72690}
This commit is contained in:
parent
e5cf754b67
commit
587e7163cd
@ -100,8 +100,10 @@ class CSignatureOf : public CSignature {
|
||||
static_assert(
|
||||
std::is_same<decltype(*reps_), decltype(*param_types.data())>::value,
|
||||
"type mismatch, cannot memcpy");
|
||||
memcpy(storage_ + kReturnCount, param_types.data(),
|
||||
sizeof(*storage_) * kParamCount);
|
||||
if (kParamCount > 0) {
|
||||
memcpy(storage_ + kReturnCount, param_types.data(),
|
||||
sizeof(*storage_) * kParamCount);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user