Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"go-fuzz-build" leads to "misplaced compiler directive" #301

Closed
lipeng28 opened this issue Sep 24, 2020 · 4 comments
Closed

"go-fuzz-build" leads to "misplaced compiler directive" #301

lipeng28 opened this issue Sep 24, 2020 · 4 comments

Comments

@lipeng28
Copy link

Hi There,

When I tried to compile project with go-fuzz-build, I encounter the following error, the $GO111MODULE is on:

failed to execute go build: exit status 2

reflect

/home/tiger/go/src/reflect/value.go:1432: misplaced compiler directive

Thanks
Peng

@thepudds
Copy link
Collaborator

Hi @lipeng28 please also see #294.

@lipeng28
Copy link
Author

Hi @thepudds , thanks for pointing it out, however, I do not think this thread includes the resolution to this issue, right?

@lipeng28
Copy link
Author

Hi @thepudds

I found if I add one space before go:nocheckptr, then the problem is resolved.
Do you think this is a problem of GoLang or go-fuzz?

Thanks
Peng

// go:nocheckptr
// This prevents inlining Value.Pointer when -d=checkptr is enabled,
// which ensures cmd/compile can recognize unsafe.Pointer(v.Pointer())
// and make an exception.

// Pointer returns v's value as a uintptr.
// It returns uintptr instead of unsafe.Pointer so that
// code using reflect cannot obtain unsafe.Pointers
// without importing the unsafe package explicitly.
// It panics if v's Kind is not Chan, Func, Map, Ptr, Slice, or UnsafePointer.
//
// If v's Kind is Func, the returned pointer is an underlying
// code pointer, but not necessarily enough to identify a
// single function uniquely. The only guarantee is that the
// result is zero if and only if v is a nil func Value.
//
// If v's Kind is Slice, the returned pointer is to the first
// element of the slice. If the slice is nil the returned value
// is 0. If the slice is empty but non-nil the return value is non-zero.

@josharian
Copy link
Collaborator

It’s a bug in go-fuzz. But we are already tracking the bug in #294 , so I’m going to close this issue. Let’s continue discussion in #294.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants