Fix segfault in Allegrocl - a proper fix is still needed

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13558 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-08-08 06:08:36 +00:00
commit 8a94438c7d

View file

@ -1181,13 +1181,14 @@ void emit_synonym(Node *synonym) {
String *of_name = namespaced_name(of, of_ns); String *of_name = namespaced_name(of, of_ns);
if (CPlusPlus && !Strcmp(nodeType(synonym), "cdecl")) { if (CPlusPlus && !Strcmp(nodeType(synonym), "cdecl")) {
syn_ltype = NewStringf("#.(swig-insert-id \"%s\" %s :type :class)", String *real_name = Getattr(synonym, "real-name");
strip_namespaces(Getattr(synonym, "real-name")), synonym_ns); if (!real_name)
syn_type = NewStringf("#.(swig-insert-id \"%s\" %s :type :type)", real_name = NewString("Unknown"); // TODO: fix
strip_namespaces(Getattr(synonym, "real-name")), synonym_ns); syn_ltype = NewStringf("#.(swig-insert-id \"%s\" %s :type :class)", strip_namespaces(real_name), synonym_ns);
syn_type = NewStringf("#.(swig-insert-id \"%s\" %s :type :type)", strip_namespaces(real_name), synonym_ns);
} else { } else {
syn_ltype = lookup_defined_foreign_ltype(synonym_type); syn_ltype = lookup_defined_foreign_ltype(synonym_type);
syn_type = lookup_defined_foreign_type(synonym_type); syn_type = lookup_defined_foreign_type(synonym_type);
} }
of_ltype = lookup_defined_foreign_ltype(of_name); of_ltype = lookup_defined_foreign_ltype(of_name);