Skip to content

Commit 7d10fd2

Browse files
authored
Added the same stop for unarrayed struct as the arrayed struct when getting the compsite sub reference. (#1978)
1 parent 6c2bcd5 commit 7d10fd2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

trick_source/sim_services/CheckPointAgent/ClassicCheckPointerAgent.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ static int getCompositeSubReference(
322322
}
323323
/*if member is an unarrayed struct, continue to call getCompositeSubReference.*/
324324
if (Ai->num_index == 0) {
325+
/* if left_type specifies the current member, stop here */
326+
if ( (left_type != NULL) && (*left_type != NULL) && (Ai->attr == (*left_type)->attr)) {
327+
return 0;
328+
}
329+
325330
char buf[256];
326331
ret = getCompositeSubReference( rAddr, left_type, sAddr + Ai->offset, (ATTRIBUTES *) Ai->attr, buf);
327332

0 commit comments

Comments
 (0)