Changeset 4226


Ignore:
Timestamp:
Oct 8, 2014, 2:28:32 PM (4 years ago)
Author:
nmedfort
Message:

Potential segfault bug fix. Tested on Clang 3.4-1ubuntu3 and gcc 4.9.1. Intermittent stall noticed with gcc 4.8.2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r4209 r4226  
    319319    struct Basis_bits basis_bits;
    320320    struct Output output;
    321 
    322     BitBlock carry_q[carry_count];
    323     memset (carry_q, 0, sizeof(BitBlock) * carry_count);
    324 
    325321    BitBlock match_vector = simd<1>::constant<0>();
     322    BitBlock * carry_q = new BitBlock[carry_count];
    326323    int match_count=0;
    327324    int blk = 0;
     
    331328    int chars_avail = 0;
    332329    int chars_read  = 0;
    333 
    334330    int line_start = 0;
    335331    int line_end = 0;
     
    339335    ScannerT LF_scanner;
    340336    ScannerT match_scanner;
     337
     338    memset (carry_q, 0, sizeof(BitBlock) * carry_count);
    341339
    342340    char * buffer_ptr;
     
    430428        line_start -= SEGMENT_SIZE;  /* Will be negative offset for use within next segment. */
    431429        chars_avail -= SEGMENT_SIZE;
    432 
    433430#endif
    434431    }
     
    527524
    528525    buffer_pos += chars_avail;
     526    delete carry_q;
    529527}
    530528
Note: See TracChangeset for help on using the changeset viewer.