From 287e84d84c38950c71706533a6aac0a769a107f9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 14 Jul 2014 08:33:43 -0700 Subject: [PATCH] [Go] Change struct definition to use void *, not uint8, so that the type is recorded as possibly containing pointers. This ensures that the 1.3 garbage collector does not collect pointers passed to C++ code. --- CHANGES.current | 6 ++++++ Source/Modules/go.cxx | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index d3015a0ba..d3d461adc 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,12 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.3 (in progress) =========================== +2014-07-14: ianlancetaylor + [Go] Change struct definition to use void *, not uint8, so + that the type is recorded as possibly containing + pointers. This ensures that the 1.3 garbage collector + does not collect pointers passed to C++ code. + 2014-07-01: wsfulton Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains brackets in the expanded name. diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index e84109faf..2de066b5d 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -1206,7 +1206,7 @@ private: } if (Len(parm_size) == 0) { - Append(parm_size, "1"); + Append(parm_size, "SWIG_PARM_SIZE"); } String *fn_name; @@ -1220,7 +1220,7 @@ private: } // \xc2\xb7 is UTF-8 for U+00B7 which is Unicode 'Middle Dot' - Printv(f->def, "\xc2\xb7", fn_name, "(struct { uint8 x[", parm_size, "];} p)", NULL); + Printv(f->def, "\xc2\xb7", fn_name, "(struct { void *x[(", parm_size, ") / SWIG_PARM_SIZE];} p)", NULL); Delete(fn_name); Delete(parm_size);