]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't record references to null declarations
authorMikko Rasa <tdb@tdb.fi>
Sat, 16 Oct 2021 13:53:21 +0000 (16:53 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 16 Oct 2021 16:03:01 +0000 (19:03 +0300)
source/glsl/optimize.cpp

index 08d9259942a6a5b3d27566baf0902179221f2555..3cb10e862458903a0d07c2da1eec7465e3299ac5 100644 (file)
@@ -1324,7 +1324,7 @@ void UnusedVariableRemover::visit(VariableReference &var)
 {
        if(composite_reference)
                r_reference.declaration = var.declaration;
-       else
+       else if(var.declaration)
                referenced(var.declaration, var);
 }
 
@@ -1332,7 +1332,7 @@ void UnusedVariableRemover::visit(InterfaceBlockReference &iface)
 {
        if(composite_reference)
                r_reference.declaration = iface.declaration;
-       else
+       else if(iface.declaration)
                referenced(iface.declaration, iface);
 }