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

bug: Function signatures generate incorrect argument size #195

Closed
Yawning opened this issue Aug 10, 2021 · 5 comments
Closed

bug: Function signatures generate incorrect argument size #195

Yawning opened this issue Aug 10, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@Yawning
Copy link

Yawning commented Aug 10, 2021

avo: TEXT("Example", NOSPLIT|NOFRAME, "func(x *uint64, y uint32)")
asm: TEXT ·Example(SB), NOSPLIT|NOFRAME, $0-16

go vet complains ./bug.s:6:1: [amd64] Example: wrong argument size 16; expected $...-12

This may very well be go vet being silly, but I'm not sure if there's supposed to be padding there or not.

@mmcloughlin
Copy link
Owner

Sorry I missed this. I've seen something similar to this before and I wonder if it's related: golang/go#39220.

@mmcloughlin
Copy link
Owner

Ah... I might have responded to quickly there. This could be an avo issue. I remember that the specifics of function argument/return value padding are a little subtle and poorly documented. I'll have to take a look and get back to you.

@mmcloughlin
Copy link
Owner

Okay, I'm almost certain this is the same bug as #191, just fixed in #212. Let me check.

mmcloughlin added a commit that referenced this issue Oct 30, 2021
mmcloughlin added a commit that referenced this issue Oct 30, 2021
Adds test cases for the bug in #195, similar to #212.

Updates #195
Updates #191
@mmcloughlin
Copy link
Owner

Yes this seems to have been the exact same thing. I landed a regression test in #214.

@mmcloughlin mmcloughlin added the bug Something isn't working label Oct 30, 2021
mmcloughlin added a commit that referenced this issue Oct 31, 2021
Adds a test for function signature memory layout by generating functions with
random signatures. This confirms that the size and offsets computed by
`gotypes` agree with `asmdecl`.

Updates #191 #195
@mmcloughlin
Copy link
Owner

I believe this is fixed, with an extensive test added in #216. Tagged release v0.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants