Hannes Siebenhandl pushed to branch wip/fendor/post-string-len-assertion at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • rts/eventlog/EventLog.c
    ... ... @@ -197,7 +197,7 @@ static inline void postBuf(EventsBuf *eb, const StgWord8 *buf, uint32_t size)
    197 197
     static inline void postStringLen(EventsBuf *eb, const char *buf, StgWord len)
    
    198 198
     {
    
    199 199
         if (buf) {
    
    200
    -        ASSERT(eb->begin + eb->size > eb->pos + len + 1);
    
    200
    +        ASSERT(eb->pos + len + 1 <= eb->begin + eb->size);
    
    201 201
             memcpy(eb->pos, buf, len);
    
    202 202
             eb->pos += len;
    
    203 203
         }