diff options
author | Fangrui Song <maskray@google.com> | 2020-05-03 21:54:28 -0700 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-05-03 21:57:51 -0700 |
commit | 762fb1c40eea6878c2d6a1f0f1fc7915c8747981 (patch) | |
tree | 655d71e533c6fc263860559a7b126df8a79d81fc /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 14cb0bdf2b6ca0b7befbb07fe9f73dad5786f59b (diff) | |
download | llvm-762fb1c40eea6878c2d6a1f0f1fc7915c8747981.zip llvm-762fb1c40eea6878c2d6a1f0f1fc7915c8747981.tar.gz llvm-762fb1c40eea6878c2d6a1f0f1fc7915c8747981.tar.bz2 |
[llvm-objcopy] Avoid invalid Sec.Offset after D79229
To avoid undefined behavior caught by -fsanitize=undefined on binary-paddr.test
void SectionWriter::visit(const Section &Sec) {
if (Sec.Type != SHT_NOBITS)
// Sec.Contents is empty while Sec.Offset may be out of bound
llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset);
}
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions