]> git.tdb.fi Git - libs/gl.git/commitdiff
Add a missing symmetry to linking variables
authorMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 21:25:03 +0000 (23:25 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 21:25:03 +0000 (23:25 +0200)
This caused invalid memory accesses when destroying syntax trees.

source/glsl/generate.cpp

index ad8515a94392568d4823d84bc3595c44dc9945ee..b91c2e2614ef2d577ce1e501893222eed678507d 100644 (file)
@@ -558,7 +558,10 @@ void InterfaceGenerator::visit(VariableDeclaration &var)
                        const map<string, VariableDeclaration *> &linked_vars = iface_block->linked_block->members.variables;
                        map<string, VariableDeclaration *>::const_iterator i = linked_vars.find(var.name);
                        if(i!=linked_vars.end())
+                       {
                                var.linked_declaration = i->second;
+                               var.linked_declaration->linked_declaration = &var;
+                       }
                }
                return;
        }