Dirk Mueller
c61b5d2d81
- Fix test failures with Perl 5.14 - Use upstream patch for Perl 5.12 support OBS-URL: https://build.opensuse.org/request/show/70751 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=15
20 lines
623 B
Diff
20 lines
623 B
Diff
--- trunk/Lib/perl5/perlrun.swg 2011/05/19 18:48:57 12690
|
|
+++ trunk/Lib/perl5/perlrun.swg 2011/05/19 19:31:39 12691
|
|
@@ -274,8 +274,14 @@
|
|
return SWIG_OK;
|
|
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
|
|
if (!SvROK(sv)) {
|
|
- *(ptr) = (void *) 0;
|
|
- return SWIG_OK;
|
|
+ /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
|
|
+ if (SvIOK(sv)) {
|
|
+ return SWIG_ERROR;
|
|
+ } else {
|
|
+ /* NULL pointer (reference to undef). */
|
|
+ *(ptr) = (void *) 0;
|
|
+ return SWIG_OK;
|
|
+ }
|
|
} else {
|
|
return SWIG_ERROR;
|
|
}
|