Skip to content

Commit 32cfd31

Browse files
committed
Fix crashes related to setting gl/prvalues mismatch
1 parent dd150a9 commit 32cfd31

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

clang/lib/Analysis/FlowSensitive/Models/NullPointerAnalysisModel.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Value *getValue(const Expr &Var, Environment &Env) {
224224

225225
initializeRootValue(*RootValue, Env);
226226

227-
setGLValue(Var, *RootValue, Env);
227+
setUnknownValue(Var, *RootValue, Env);
228228

229229
return RootValue;
230230
}
@@ -396,6 +396,15 @@ void matchPtrArgFunctionExpr(const CallExpr *fncall,
396396
// Should be part of the framework, most likely.
397397
}
398398
}
399+
400+
if (fncall->getCallReturnType(*Result.Context)->isPointerType()) {
401+
Value *RootValue = Env.createValue(
402+
fncall->getCallReturnType(*Result.Context));
403+
if (!RootValue)
404+
return;
405+
406+
setUnknownValue(*fncall, *RootValue, Env);
407+
}
399408
}
400409

401410
void matchAnyPointerExpr(const Expr *fncall,

0 commit comments

Comments
 (0)