summaryrefslogtreecommitdiff
path: root/Lib/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-04-17 22:20:28 -0700
committerIan Lance Taylor <iant@golang.org>2016-04-17 22:20:28 -0700
commit9cd3e28c4ea1b58e18959c038460f3fc2b2d8423 (patch)
tree6907d19cf2179015061f0dfb8597610f272c7895 /Lib/go
parent223c2a483563e5c9dd93067831a6a2af6252bcec (diff)
downloadswig-9cd3e28c4ea1b58e18959c038460f3fc2b2d8423.tar.gz
[Go] Fix "in" typemap for char *&.
Diffstat (limited to 'Lib/go')
-rw-r--r--Lib/go/go.swg9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/go/go.swg b/Lib/go/go.swg
index 40e274119..bdd2aedea 100644
--- a/Lib/go/go.swg
+++ b/Lib/go/go.swg
@@ -441,11 +441,12 @@
$1[$input.n] = '\0';
%}
-%typemap(in) char *&
+%typemap(in) char *& (char *temp)
%{
- $1 = ($1_ltype)malloc($input.n + 1);
- memcpy($1, $input.p, $input.n);
- $1[$input.n] = '\0';
+ temp = (char *)malloc($input.n + 1);
+ memcpy(temp, $input.p, $input.n);
+ temp[$input.n] = '\0';
+ $1 = ($1_ltype)&temp;
%}
%typemap(freearg)