From 6254de05efbb7e8969b0507ebc84b675a35d93ee Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Fri, 3 Jun 2022 06:50:25 -0400 Subject: [PATCH] Avoid emitting locals duiring keyword typemap lookup --- Source/Swig/typemap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Swig/typemap.c b/Source/Swig/typemap.c index c66b93ee6..2f9c06000 100644 --- a/Source/Swig/typemap.c +++ b/Source/Swig/typemap.c @@ -2101,8 +2101,9 @@ static void replace_embedded_typemap(String *s, ParmList *parm_sublist, Wrapper } found_colon = Strchr(tmap_method, ':'); if (found_colon) { + /* Substitute from a keyword argument to a typemap. Avoid emitting local variables from the attached typemap by passing NULL for the file. */ String *temp_tmap_method = NewStringWithSize(Char(tmap_method), found_colon - Char(tmap_method)); - Swig_typemap_attach_parms(temp_tmap_method, to_match_parms, f); + Swig_typemap_attach_parms(temp_tmap_method, to_match_parms, NULL); Delete(temp_tmap_method); } else { Swig_typemap_attach_parms(tmap_method, to_match_parms, f);