static bool addBB (RList *block_list, ut64 start, ut64 end, ut64 jump, ut64 fail, bb_type_t type, int score) { bb_t *bb = (bb_t*) R_NEW0 (bb_t); if (!bb) { eprintf ("Failed to calloc mem for new basic block!\n"); return false; } initBB (bb, start, end, jump, fail, type, score, 0, 0); if (jump < UT64_MAX) { bb_t *jump_bb = (bb_t*) R_NEW0 (bb_t); if (!jump_bb) { eprintf ("Failed to allocate memory for jump block\n"); free (bb); return false; } if (type == CALL) { initBB (jump_bb, jump, UT64_MAX, UT64_MAX, UT64_MAX, CALL, 0, 1, 1); } else { initBB (jump_bb, jump, UT64_MAX, UT64_MAX, UT64_MAX, JUMP, 0, 1, 0); } r_list_append (block_list, jump_bb); } if (fail < UT64_MAX) { bb_t *fail_bb = (bb_t*) R_NEW0 (bb_t); if (!fail_bb) { eprintf ("Failed to allocate memory for fail block\n"); free (bb); return false; } initBB (fail_bb, fail, UT64_MAX, UT64_MAX, UT64_MAX, FAIL, 0, 1, 0); r_list_append (block_list, fail_bb); } r_list_append (block_list, bb); return true; }
void VSResourceLib::renderBB() { if (!bbInit) return; if (!bbVAO) initBB(); mVSML->matricesToGL(); glBindVertexArray(bbVAO); glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, 0); glBindVertexArray(0); }