[all-commits] [llvm/llvm-project] 82655c: [MSan] Tweak CopyOrigin

Z via All-commits all-commits at lists.llvm.org
Tue Jan 12 17:23:49 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 82655c151450e0103a3aa60725639da607f9220c
      https://github.com/llvm/llvm-project/commit/82655c151450e0103a3aa60725639da607f9220c
  Author: Jianzhou Zhao <jianzhouzh at google.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    M compiler-rt/lib/msan/msan_poisoning.cpp

  Log Message:
  -----------
  [MSan] Tweak CopyOrigin

There could be some mis-alignments when copying origins not aligned.

I believe inaligned memcpy is rare so the cases do not matter too much
in practice.

1) About the change at line 50

Let dst be (void*)5,
then d=5, beg=4
so we need to write 3 (4+4-5) bytes from 5 to 7.

2) About the change around line 77.

Let dst be (void*)5,
because of lines 50-55, the bytes from 5-7 were already writen.
So the aligned copy is from 8.

Reviewed-by: eugenis
Differential Revision: https://reviews.llvm.org/D94552




More information about the All-commits mailing list