mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 20:51:50 +00:00
912577baec
* Avoid calling memmove(dst, nullptr, 0) as this is flagged by UBSAN. * Avoid hitting a bug[1] in the linker: LLD's identical code folding (ICF) happens to replace RecordCoverageInstr::DebugName() with DispatchTable::LargestSmallOffset() because they happen to contain the same machine code, ICF fails to accomodate that DebugName also contains a relocation to constant string. To avoid this we simply eliminate LargestSmallOffset and replace it with a constant. Same for OriginElement. TEST=manually tested previously failing tests [1]: reported https://github.com/llvm/llvm-project/issues/57693 Change-Id: I38637df6475c7670081b7af0a2de75ca37f6f07c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258801 Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Slava Egorov <vegorov@google.com>
16 lines
411 B
C++
16 lines
411 B
C++
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/dispatch_table.h"
|
|
|
|
#include "platform/assert.h"
|
|
|
|
namespace dart {
|
|
|
|
const uword* DispatchTable::ArrayOrigin() const {
|
|
return &array_.get()[kOriginElement];
|
|
}
|
|
|
|
} // namespace dart
|