Source file src/runtime/libfuzzer.go

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build libfuzzer
     6  
     7  package runtime
     8  
     9  import _ "unsafe" // for go:linkname
    10  
    11  func libfuzzerCall(fn *byte, arg0, arg1 uintptr)
    12  
    13  func libfuzzerTraceCmp1(arg0, arg1 uint8) {
    14  	libfuzzerCall(&__sanitizer_cov_trace_cmp1, uintptr(arg0), uintptr(arg1))
    15  }
    16  
    17  func libfuzzerTraceCmp2(arg0, arg1 uint16) {
    18  	libfuzzerCall(&__sanitizer_cov_trace_cmp2, uintptr(arg0), uintptr(arg1))
    19  }
    20  
    21  func libfuzzerTraceCmp4(arg0, arg1 uint32) {
    22  	libfuzzerCall(&__sanitizer_cov_trace_cmp4, uintptr(arg0), uintptr(arg1))
    23  }
    24  
    25  func libfuzzerTraceCmp8(arg0, arg1 uint64) {
    26  	libfuzzerCall(&__sanitizer_cov_trace_cmp8, uintptr(arg0), uintptr(arg1))
    27  }
    28  
    29  func libfuzzerTraceConstCmp1(arg0, arg1 uint8) {
    30  	libfuzzerCall(&__sanitizer_cov_trace_const_cmp1, uintptr(arg0), uintptr(arg1))
    31  }
    32  
    33  func libfuzzerTraceConstCmp2(arg0, arg1 uint16) {
    34  	libfuzzerCall(&__sanitizer_cov_trace_const_cmp2, uintptr(arg0), uintptr(arg1))
    35  }
    36  
    37  func libfuzzerTraceConstCmp4(arg0, arg1 uint32) {
    38  	libfuzzerCall(&__sanitizer_cov_trace_const_cmp4, uintptr(arg0), uintptr(arg1))
    39  }
    40  
    41  func libfuzzerTraceConstCmp8(arg0, arg1 uint64) {
    42  	libfuzzerCall(&__sanitizer_cov_trace_const_cmp8, uintptr(arg0), uintptr(arg1))
    43  }
    44  
    45  //go:linkname __sanitizer_cov_trace_cmp1 __sanitizer_cov_trace_cmp1
    46  //go:cgo_import_static __sanitizer_cov_trace_cmp1
    47  var __sanitizer_cov_trace_cmp1 byte
    48  
    49  //go:linkname __sanitizer_cov_trace_cmp2 __sanitizer_cov_trace_cmp2
    50  //go:cgo_import_static __sanitizer_cov_trace_cmp2
    51  var __sanitizer_cov_trace_cmp2 byte
    52  
    53  //go:linkname __sanitizer_cov_trace_cmp4 __sanitizer_cov_trace_cmp4
    54  //go:cgo_import_static __sanitizer_cov_trace_cmp4
    55  var __sanitizer_cov_trace_cmp4 byte
    56  
    57  //go:linkname __sanitizer_cov_trace_cmp8 __sanitizer_cov_trace_cmp8
    58  //go:cgo_import_static __sanitizer_cov_trace_cmp8
    59  var __sanitizer_cov_trace_cmp8 byte
    60  
    61  //go:linkname __sanitizer_cov_trace_const_cmp1 __sanitizer_cov_trace_const_cmp1
    62  //go:cgo_import_static __sanitizer_cov_trace_const_cmp1
    63  var __sanitizer_cov_trace_const_cmp1 byte
    64  
    65  //go:linkname __sanitizer_cov_trace_const_cmp2 __sanitizer_cov_trace_const_cmp2
    66  //go:cgo_import_static __sanitizer_cov_trace_const_cmp2
    67  var __sanitizer_cov_trace_const_cmp2 byte
    68  
    69  //go:linkname __sanitizer_cov_trace_const_cmp4 __sanitizer_cov_trace_const_cmp4
    70  //go:cgo_import_static __sanitizer_cov_trace_const_cmp4
    71  var __sanitizer_cov_trace_const_cmp4 byte
    72  
    73  //go:linkname __sanitizer_cov_trace_const_cmp8 __sanitizer_cov_trace_const_cmp8
    74  //go:cgo_import_static __sanitizer_cov_trace_const_cmp8
    75  var __sanitizer_cov_trace_const_cmp8 byte
    76  

View as plain text