Changeset 5207 for icGREP/icgrep-devel


Ignore:
Timestamp:
Nov 7, 2016, 9:51:04 PM (3 years ago)
Author:
xwa163
Message:

fix build fail caused by memory align

File:
1 edited

Legend:

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

    r5206 r5207  
    479479
    480480    std::string str = UCD::getPropertyValueGrepString(propertyName);
    481 
    482     //use const_cast to workaround const input
    483     mGrepFunction(const_cast<char*>(str.c_str()), str.size(), 0);
     481    char* grepInput = nullptr;
     482    posix_memalign( (void**)&grepInput, 32, str.size() * sizeof(char));
     483    strncpy(grepInput, str.c_str(), str.size());
     484    mGrepFunction(grepInput, str.size(), 0);
     485    free(grepInput);
    484486
    485487    return getParsedProeprtyValues();
Note: See TracChangeset for help on using the changeset viewer.