Skip to content

Commit

Permalink
[GR-47762] Fix null object case in PrintImageHeapConnectedComponents
Browse files Browse the repository at this point in the history
PullRequest: graal/15172
  • Loading branch information
mspasic-oracle committed Sep 14, 2023
2 parents 5623fe6 + 388e6e2 commit aa632c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -374,7 +374,7 @@ private void printObjectsToJson(JsonWriter writer, Collection<ObjectInfo> object
for (Iterator<ObjectInfo> iterator = objects.iterator(); iterator.hasNext();) {
ObjectInfo objectInfo = iterator.next();
writer.append('{');
writer.quote("className").append(':').quote(objectInfo.getObject().getClass().getName()).append(',');
writer.quote("className").append(':').quote(objectInfo.getObjectClass().getName()).append(',');
writer.quote("identityHashCode").append(':').quote(String.valueOf(objectInfo.getIdentityHashCode())).append(',');
writer.quote("constantValue").append(':').quote(constantAsRawString(bb, objectInfo.getConstant())).append(',');
printReasonToJson(objectInfo.getMainReason(), writer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ static int getFlagForObjectInfo(ObjectInfo object, Object firstReason, Map<Objec
if (object.getObjectClass().equals(ImageCodeInfo.class)) {
result |= ImageCodeInfo.flag;
}
if (object.getObject().getClass().equals(DynamicHub.class) || object.getObject().getClass().equals(DynamicHubCompanion.class)) {
if (object.getObject() != null && (object.getObject().getClass().equals(DynamicHub.class) || object.getObject().getClass().equals(DynamicHubCompanion.class))) {
result |= DynamicHubs.flag;
}
result |= getByReason(firstReason, additionalReasonInfoHashMap);
Expand Down

0 comments on commit aa632c8

Please sign in to comment.