aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_linux.h
diff options
context:
space:
mode:
authorAlexander Egorenkov <Alexander.Egorenkov@ibm.com>2020-06-02 09:28:11 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-06-23 16:18:44 +0200
commite5d10a43278b10875ef0a80be4af2d1b5692c1c9 (patch)
tree5d573de44c3c373721e7f36c12170a44109f20f6 /executor/executor_linux.h
parent54566aff1679fc74487d3efb9f7bbfbc21beed4b (diff)
ipc: fix endianness issues
Use native byte-order for IPC and program serialization. This way we will be able to support both little- and big-endian architectures. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
Diffstat (limited to 'executor/executor_linux.h')
-rw-r--r--executor/executor_linux.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/executor/executor_linux.h b/executor/executor_linux.h
index 47804f4f4..98b89fc9a 100644
--- a/executor/executor_linux.h
+++ b/executor/executor_linux.h
@@ -167,8 +167,10 @@ static void cover_reset(cover_t* cov)
static void cover_collect(cover_t* cov)
{
- // Note: this assumes little-endian kernel.
- cov->size = *(uint32*)cov->data;
+ if (is_kernel_64_bit)
+ cov->size = *(uint64*)cov->data;
+ else
+ cov->size = *(uint32*)cov->data;
}
static bool cover_check(uint32 pc)