MCPcopy Create free account
hub / github.com/csmith-project/csmith / config_active_blks

Method config_active_blks

src/Reducer.cpp:971–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971void
972Reducer::config_active_blks(string cmd)
973{
974 size_t i;
975 vector<string> tmp_strs;
976 if (cmd == "poll") {
977 dump_block_entry = true;
978 } else if (cmd == "blind poll") {
979 dump_all_block_info = true;
980 }
981 else {
982 tmp_strs.clear();
983 bool take_diff_branch = false;
984 if (cmd.find("||") != string::npos) {
985 StringUtils::split_string(cmd, tmp_strs, "|");
986 assert(tmp_strs.size() == 2);
987 cmd = tmp_strs[0];
988 int blkid = StringUtils::str2int(tmp_strs[1]);
989 take_diff_branch = configure_diff_active_blks(cmd, blkid);
990 }
991 if (!take_diff_branch) {
992 StringUtils::split_string(cmd, tmp_strs, ",()");
993 for (i=0; i<tmp_strs.size(); i+=2) {
994 const Block* blk = find_block_by_id(StringUtils::str2int(tmp_strs[i]));
995 assert(i+1 < tmp_strs.size());
996 int cnt = StringUtils::str2int(tmp_strs[i+1]);
997 assert(blk);
998 map_active_blks[blk] = cnt;
999 // for rollback blocks, find the parant blocks and put them on active block list as well
1000 if (cnt == 0) {
1001 for (const Block* b = blk->parent; b != NULL; b = b->parent) {
1002 if (map_active_blks.find(b) != map_active_blks.end()) {
1003 break;
1004 }
1005 map_active_blks[b] = 0;
1006 }
1007 }
1008 }
1009 }
1010 }
1011}
1012
1013void
1014Reducer::config_call_chain_shortcut(string cmd)

Callers

nothing calls this directly

Calls 4

find_block_by_idFunction · 0.85
sizeMethod · 0.80
endMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected