Skip to content

Commit

Permalink
cmd/compile: rename libfuzzerCallTraceInit
Browse files Browse the repository at this point in the history
  • Loading branch information
kyakdan committed Mar 6, 2022
1 parent 28781ec commit 3e0442f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/runtime/libfuzzer.go
Expand Up @@ -8,7 +8,7 @@ package runtime

import "unsafe"

func libfuzzerCallTraceInit(fn, start, end *byte)
func libfuzzerCallWithTwoByteBuffers(fn, start, end *byte)
func libfuzzerCall(fn *byte, arg0, arg1 uintptr)

func libfuzzerTraceCmp1(arg0, arg1 uint8) {
Expand Down Expand Up @@ -46,7 +46,7 @@ func libfuzzerTraceConstCmp8(arg0, arg1 uint64) {
var pcTables []byte

func libfuzzerInitializeCounters() {
libfuzzerCallTraceInit(&__sanitizer_cov_8bit_counters_init, &__start___sancov_cntrs, &__stop___sancov_cntrs)
libfuzzerCallWithTwoByteBuffers(&__sanitizer_cov_8bit_counters_init, &__start___sancov_cntrs, &__stop___sancov_cntrs)
start := unsafe.Pointer(&__start___sancov_cntrs)
end := unsafe.Pointer(&__stop___sancov_cntrs)

Expand All @@ -56,7 +56,7 @@ func libfuzzerInitializeCounters() {
// get a pointer representing the end of the PC table array.
size := (uintptr(end)-uintptr(start))*unsafe.Sizeof(uintptr(0))*2 + 1
pcTables = make([]byte, size)
libfuzzerCallTraceInit(&__sanitizer_cov_pcs_init, &pcTables[0], &pcTables[size-1])
libfuzzerCallWithTwoByteBuffers(&__sanitizer_cov_pcs_init, &pcTables[0], &pcTables[size-1])
}

func init() {
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/libfuzzer_amd64.s
Expand Up @@ -41,9 +41,9 @@ call:
MOVQ R12, SP
RET

// void runtime·libfuzzerCallTraceInit(fn, arg0, arg1 *byte)
// Calls C function fn from libFuzzer and passes 2 arguments to it.
TEXT runtime·libfuzzerCallTraceInit(SB), NOSPLIT, $0-24
// void runtime·libfuzzerCallWithTwoByteBuffers(fn, arg0, arg1 *byte)
// Calls C function fn from libFuzzer and passes 2 arguments of type *byte to it.
TEXT runtime·libfuzzerCallWithTwoByteBuffers(SB), NOSPLIT, $0-24
MOVQ fn+0(FP), AX
MOVQ start+8(FP), RARG0
MOVQ end+16(FP), RARG1
Expand Down

0 comments on commit 3e0442f

Please sign in to comment.