Fix SF #3194294 - corner case bug when 'NULL' is used as the default value for a primitive type parameter in a method declaration.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12525 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b69b793d8e
commit
5f4d8c6112
5 changed files with 33 additions and 1 deletions
10
Examples/test-suite/default_arg_values.i
Normal file
10
Examples/test-suite/default_arg_values.i
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
%module default_arg_values
|
||||
|
||||
%inline %{
|
||||
struct Display {
|
||||
// Bad Python wrappers were being generated when NULL used for primitive type
|
||||
float draw1(float v = NULL) { return v; }
|
||||
float draw2(float *v = NULL) { return v ? *v : 0; }
|
||||
};
|
||||
float* createPtr(float v) { static float val; val = v; return &val; }
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue