Skip to content

Conversation

@bendikro
Copy link

This PR adds two commits. One to fix the dreaded panic: runtime error: cgo argument has Go pointer to Go pointer, and one to fix the test TestStackArguments which was fixed by disabling compiler optimizations.

The PR also includes the commit from tiborvass' PR

tiborvass and others added 3 commits February 10, 2016 01:49
Signed-off-by: Tibor Vass <teabee89@gmail.com>
In Go 1.6, arguments passed to C cannot be a Go pointer
to memory containing Go pointers.

Fix by converting argument to uintptr instead of unsafe.Pointer
Calling sum8 in TestStackArguments fails apparently due to
compiler optimizations which leads the function return value
to be 0 instead of the expected 36.

Fix by disabling compiler optimizations in CFLAGS
@bendikro bendikro mentioned this pull request Apr 10, 2019
@bendikro
Copy link
Author

The issue with TestStackArguments is caused by a bug which is better solved by a proper bug fix in #11

@bendikro bendikro closed this Apr 10, 2019
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

Successfully merging this pull request may close these issues.

3 participants