Some safe coding. Check that pointer is not null.

This commit is contained in:
Dmitry-Me 2014-08-14 16:10:12 +02:00 committed by Daniel Marjamäki
parent 543589564d
commit 7e442cf75d
1 changed files with 4 additions and 2 deletions

View File

@ -148,10 +148,12 @@ void Variables::alias(unsigned int varid1, unsigned int varid2, bool replace)
VariableUsage *var1 = find(varid1);
VariableUsage *var2 = find(varid2);
if (!var1 || !var2)
return;
// alias to self
if (varid1 == varid2) {
if (var1)
var1->use(_varReadInScope);
var1->use(_varReadInScope);
return;
}