/[jscoverage]/trunk/js/jsopcode.cpp
ViewVC logotype

Diff of /trunk/js/jsopcode.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 507 by siliconforks, Sun Jan 10 07:23:34 2010 UTC revision 585 by siliconforks, Sun Sep 12 15:13:23 2010 UTC
# Line 548  Line 548 
548  static ptrdiff_t  static ptrdiff_t
549  SprintPut(Sprinter *sp, const char *s, size_t len)  SprintPut(Sprinter *sp, const char *s, size_t len)
550  {  {
551      ptrdiff_t offset;      ptrdiff_t offset = sp->size; /* save old size */
552      char *bp;      char *bp = sp->base;         /* save old base */
553    
554      /* Allocate space for s, including the '\0' at the end. */      /* Allocate space for s, including the '\0' at the end. */
555      if (!SprintEnsureBuffer(sp, len))      if (!SprintEnsureBuffer(sp, len))
556          return -1;          return -1;
557    
558        if (sp->base != bp &&               /* buffer was realloc'ed */
559            s >= bp && s < bp + offset) {   /* s was within the buffer */
560            s = sp->base + (s - bp);        /* this is where it lives now */
561        }
562    
563      /* Advance offset and copy s into sp's buffer. */      /* Advance offset and copy s into sp's buffer. */
564      offset = sp->offset;      offset = sp->offset;
565      sp->offset += len;      sp->offset += len;

Legend:
Removed from v.507  
changed lines
  Added in v.585

  ViewVC Help
Powered by ViewVC 1.1.24