[perl-Glib-Object-Introspection] Do not crash on inexistent GTypes on perl 5.8.x



commit 51cbc38ad2800327bd39ba821961082e7e53ef4c
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date:   Tue May 15 22:56:30 2012 +0200

    Do not crash on inexistent GTypes on perl 5.8.x
    
    In older perls, newSVpv apparently was not NULL-safe.

 NEWS                     |    1 +
 gperl-i11n-marshal-arg.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index ae78744..061cfc3 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Overview of changes in Glib::Object::Introspection <next>
 * Allow setting boxed fields to undef.
 * Do not pass on an incorrect destroy notify func if there is no
   callback.
+* Do not crash on inexistent GTypes on perl 5.8.x.
 
 Overview of changes in Glib::Object::Introspection 0.008
 ========================================================
diff --git a/gperl-i11n-marshal-arg.c b/gperl-i11n-marshal-arg.c
index c79fdf0..c468675 100644
--- a/gperl-i11n-marshal-arg.c
+++ b/gperl-i11n-marshal-arg.c
@@ -199,6 +199,8 @@ arg_to_sv (GIArgument * arg,
 		const char *package = gperl_package_from_type (arg->v_size);
 		if (!package)
 			package = g_type_name (arg->v_size);
+		if (!package)
+			return &PL_sv_undef;
 		return newSVpv (package, PL_na);
 	    }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]