Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ int getTrailingZerosCount(const SVal &V, ProgramStateRef State,

// Sealed capabilities cannot be dereferenced, and any type-punning
// will be dynamically checked during unsealing.
if (V.getType(ASTCtx)->isCHERISealedCapabilityType(ASTCtx))
auto Ty = V.getType(ASTCtx);
if (!Ty.isNull() && Ty->isCHERISealedCapabilityType(ASTCtx))
return -1;

if (V.isConstant()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %cheri_purecap_cc1 -analyze %s \
// RUN: -analyzer-checker=core,cheri.SubObjectRepresentability

struct a {
unsigned b;
};
void c(unsigned a::*d) {
d == &a::b;
c(&a::b);
}