Fix segmentation fault when top==NULL

Introduced by nested class handling (reported in issue#346 by Paweł Tomulik).
This commit is contained in:
Olly Betts 2015-02-26 14:56:29 +13:00
commit de1cae9319
2 changed files with 8 additions and 0 deletions

View file

@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.6 (in progress)
===========================
2015-02-26: olly
Fix segmentation fault when top==NULL, introduced by nested class
handling (reported in issue#346 by Paweł Tomulik).
2015-02-09: wsfulton
[Guile] Fix generated code for static const char member variables when
defined and declared inline.

View file

@ -340,6 +340,8 @@ static void insertNodeAfter(Node *n, Node *c) {
}
void Swig_nested_name_unnamed_c_structs(Node *n) {
if (!n)
return;
if (!classhash)
classhash = Getattr(n, "classes");
Node *c = firstChild(n);
@ -427,6 +429,8 @@ static void remove_outer_class_reference(Node *n) {
}
void Swig_nested_process_classes(Node *n) {
if (!n)
return;
Node *c = firstChild(n);
while (c) {
Node *next = nextSibling(c);