File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ void prindatum(LispPTR x) {
9898 break ;
9999 case TYPE_ONED_ARRAY :
100100 case TYPE_GENERAL_ARRAY :
101+ /* this should probably use array.h's arrayheader */
101102 newstring = (NEWSTRINGP * )NativeAligned4FromLAddr (x );
102103 if (newstring -> stringp ) {
103104 print_NEWstring (x );
104105 }
106+ /* it would be useful to print non-string arrays, too */
105107 break ;
106108 default : dtd_base = (struct dtd * )GetDTD (typen ); printf ("{" );
107109#ifdef BIGVM
@@ -173,14 +175,20 @@ void print_string(LispPTR x) {
173175void print_NEWstring (LispPTR x ) {
174176 NEWSTRINGP * string_point ;
175177 DLword st_length ;
178+ DLword st_offset ;
176179 DLbyte * string_base ;
177180
178181 int i ;
179182
180183 string_point = (NEWSTRINGP * )NativeAligned4FromLAddr (x );
181184 st_length = string_point -> fillpointer ;
185+ st_offset = string_point -> offset ;
186+ if (string_point -> indirectp ) {
187+ /* base points to another array header not the raw storage */
188+ string_point = (NEWSTRINGP * )NativeAligned4FromLAddr (string_point -> base );
189+ }
182190 string_base = (DLbyte * )NativeAligned2FromLAddr (string_point -> base );
183- string_base += string_point -> offset ;
191+ string_base += st_offset ;
184192
185193 printf ("%c" , DOUBLEQUOTE ); /* print %" */
186194
You can’t perform that action at this time.
0 commit comments