Skip to content

Commit 2751736

Browse files
committed
update
1 parent e33499e commit 2751736

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ddprof-lib/src/main/cpp/vmStructs.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ inline T* cast_to(const void* ptr, uint64_t size) {
3535
public: \
3636
static uint64_t type_size() { return TYPE_SIZE_NAME(name); } \
3737
static name * cast(const void* ptr) { return cast_to<name>(ptr, type_size()); } \
38-
static name * load_then_cast(const void* ptr) { return cast(*(const void**)ptr); }
38+
static name * load_then_cast(const void* ptr) { \
39+
assert(ptr != nullptr); \
40+
return cast(*(const void**)ptr); }
3941

4042
#define DECL_TYPE_END };
4143

4244
#define MATCH_SYMBOLS(...) __VA_ARGS__, nullptr
4345

44-
// Define a type anme and its size symbols for VMStructs.
46+
// Defines a type and its matching symbols in vmStructs.
4547
// A type may match multiple names in different JVM versions.
4648
#define DECL_TYPES_DO(f) \
4749
f(VMClassLoaderData, MATCH_SYMBOLS("ClassLoaderData")) \

0 commit comments

Comments
 (0)