]> Cypherpunks repositories - gostls13.git/commitdiff
fix traceback prints - %S was not advancing pointer enough
authorRuss Cox <rsc@golang.org>
Thu, 16 Apr 2009 01:52:28 +0000 (18:52 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 16 Apr 2009 01:52:28 +0000 (18:52 -0700)
R=r
DELTA=6  (5 added, 1 deleted, 0 changed)
OCL=27500
CL=27525

src/runtime/print.c

index 974d3d72ed70a5db0597817c3475ab54494e037f..5295e338d1ea18ca58f20733cd7bb8137566b0c1 100644 (file)
@@ -58,11 +58,15 @@ printf(int8 *s, ...)
                        break;
                case 'p':       // pointer-sized
                case 's':
-               case 'S':
                        if(sizeof(uintptr) == 8 && ((uint32)(uint64)arg)&4)
                                arg += 4;
                        narg = arg + sizeof(uintptr);
                        break;
+               case 'S':       // pointer-aligned but bigger
+                       if(sizeof(uintptr) == 8 && ((uint32)(uint64)arg)&4)
+                               arg += 4;
+                       narg = arg + sizeof(String);
+                       break;
                }
                switch(*p) {
                case 'd':