Skip to content

Commit

Permalink
runtime: define dummy msanmove
Browse files Browse the repository at this point in the history
In msan mode we instrument code with msan* functions, including
msanmove. In some configurations the code is instrumented by the
compiler but msan is not actually linked in, so we need dummy
definitions for those functions so the program links. msanmove is
newly added in CL 270859 but a dummy definition in msan0.go was
not added, causing link failures. Add it.

Change-Id: I91f8e749919f57f1182e90b43412b0282cf4767c
Reviewed-on: https://go-review.googlesource.com/c/go/+/285955
Trust: Cherry Zhang <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
cherrymui committed Jan 22, 2021
1 parent 3a778ff commit eb21b31
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/runtime/msan0.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const msanenabled = false

// Because msanenabled is false, none of these functions should be called.

func msanread(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanwrite(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanmalloc(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanfree(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanread(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanwrite(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanmalloc(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanfree(addr unsafe.Pointer, sz uintptr) { throw("msan") }
func msanmove(dst, src unsafe.Pointer, sz uintptr) { throw("msan") }

0 comments on commit eb21b31

Please sign in to comment.