diff options
| author | 2022-01-06 17:52:17 +0000 | |
|---|---|---|
| committer | 2022-01-13 10:58:56 +0000 | |
| commit | 71987f90de73092bf55dbe229589a4379a2f71fb (patch) | |
| tree | e2d584164aba94c488d019c2cd419c2f45ef9de1 /disassembler/disassembler.h | |
| parent | cc809a55aaed91ce54c0dde6efbc9bd4acb4eea5 (diff) | |
Fix ReadMagicAndReset.
ReadMagicAndReset is a function that is supposed to read a uint32_t
from the beginning of a file. However, it cannot handle the case where
the file offset of the fd is non-zero. Specifically, when an fd is
passed from dex2oat, dex2oat has probably read that file, causing the
file offset to be non-zero. This CL fixes the problem by resetting the
file offest before reading from the fd. Ideally, we should use `pread`,
but `ReadMagicAndReset` is part of `libartbase`, which has to support
Windows build where `pread` is not supported.
This change fixes odrefresh, which invokes dex2oat with fds.
Bug: 213446666
Test: atest odsign_e2e_tests
(cherry picked from commit 0628e784532303b27e062ed957494bfd7e858bd9)
Merged-In: Ib5dd8e2855a4f0a391afa5313cf3a2d12f1a3121
Change-Id: I6cfba0cfbcee0a1f914cbc661d2af428292a3533
Diffstat (limited to 'disassembler/disassembler.h')
0 files changed, 0 insertions, 0 deletions