From: Mikko Rasa Date: Sat, 16 Oct 2021 13:53:21 +0000 (+0300) Subject: Don't record references to null declarations X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=95312044b7b474af5671eb67f9df8debf96bf54c;p=libs%2Fgl.git Don't record references to null declarations --- diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 08d92599..3cb10e86 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -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); }