mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:59:38 +00:00
[VM/Runtime] - Fix ubsan warning.
TEST=ci Change-Id: I9881db82771c51a1df8fe930fe2216ddf87f5746 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285345 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
c90821350e
commit
a346af7b7a
|
@ -509,7 +509,10 @@ CodeSourceMapPtr CodeSourceMapBuilder::Finalize() {
|
|||
intptr_t length = stream_.bytes_written();
|
||||
const auto& map = CodeSourceMap::Handle(zone_, CodeSourceMap::New(length));
|
||||
NoSafepointScope no_safepoint;
|
||||
memmove(map.Data(), stream_.buffer(), length);
|
||||
if (length > 0) {
|
||||
ASSERT(stream_.buffer() != nullptr);
|
||||
memmove(map.Data(), stream_.buffer(), length);
|
||||
}
|
||||
return map.ptr();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue