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

x/mobile/bind: Second string argument in Objective-C generated functions is empty #11842

Closed
mpiannucci opened this issue Jul 23, 2015 · 2 comments

Comments

@mpiannucci
Copy link

When a function with two string arguments is generated, the Objective-C binding doesn't pass the second string correctly if the first string argument is longer than 11 characters.

For example, with the function:

func(e *ExampleStruct) TryTwoStrings(first, second string) {
    fmt.Println("First: " + first)
    fmt.Println("Second " + second)
}

If it is called with an instance of ExampleStruct

[exampleStruct TryTwoStrings:@"trytwotests" second:@"test"]

the output is as expected:

First: trytwotests
Second: test

But if the trytwotestsstring is made longer, the output is incorrect:

[exampleStruct TryTwoStrings:@"trytwotested" second:@"test"]
First: trytwotested
Second: 

Go version:

go version devel +328ff1f Mon Jul 20 23:36:13 2015 +0000 darwin/amd64
@crawshaw
Copy link
Member

CC @hyangah

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jul 23, 2015
@gopherbot
Copy link

CL https://golang.org/cl/12577 mentions this issue.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Also, fixes the memory allocation bug - misuse of mem_ensure that caused
to allocate 72 bytes of memory to carry 16 bytes of data for instance.

Fixes golang/go#11842.

Change-Id: I21798be2ec7adfb68cc2897bb46a924f05f3478c
Reviewed-on: https://go-review.googlesource.com/12577
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Also, fixes the memory allocation bug - misuse of mem_ensure that caused
to allocate 72 bytes of memory to carry 16 bytes of data for instance.

Fixes golang/go#11842.

Change-Id: I21798be2ec7adfb68cc2897bb46a924f05f3478c
Reviewed-on: https://go-review.googlesource.com/12577
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants