Don't override existing entries when inheriting various hashes.
Check if the value being inherited doesn't already exist for the derived class: if it does, we must not overwrite it. Fixes regression introduced in r12865. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e7a4f42877
commit
9cdc66cc84
1 changed files with 5 additions and 4 deletions
|
|
@ -590,11 +590,12 @@ void Swig_name_object_inherit(Hash *namehash, String *base, String *derived) {
|
|||
Hash *n = ki.item;
|
||||
Hash *newh;
|
||||
|
||||
if (!derh)
|
||||
derh = NewHash();
|
||||
|
||||
newh = Getattr(derh, nkey);
|
||||
/* Don't overwrite an existing value for the derived class, if any. */
|
||||
newh = Getattr(namehash, nkey);
|
||||
if (!newh) {
|
||||
if (!derh)
|
||||
derh = NewHash();
|
||||
|
||||
newh = NewHash();
|
||||
Setattr(derh, nkey, newh);
|
||||
Delete(newh);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue