Fix GraphEdge initialization in DisassemblerGraphView (#1436)

This commit is contained in:
Florian Märkl 2019-04-07 13:34:53 +02:00 committed by GitHub
parent 3e645980fc
commit cdca7bdc3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -249,13 +249,13 @@ void DisassemblerGraphView::loadCurrentGraph()
db.false_path = RVA_INVALID; db.false_path = RVA_INVALID;
if (block_fail) { if (block_fail) {
db.false_path = block_fail; db.false_path = block_fail;
gb.edges.push_back({block_fail}); gb.edges.emplace_back(block_fail);
} }
if (block_jump) { if (block_jump) {
if (block_fail) { if (block_fail) {
db.true_path = block_jump; db.true_path = block_jump;
} }
gb.edges.push_back({block_jump}); gb.edges.emplace_back(block_jump);
} }
QJsonObject switchOp = block["switchop"].toObject(); QJsonObject switchOp = block["switchop"].toObject();
@ -268,7 +268,7 @@ void DisassemblerGraphView::loadCurrentGraph()
if (!ok) { if (!ok) {
continue; continue;
} }
gb.edges.push_back({caseJump}); gb.edges.emplace_back(caseJump);
} }
} }

View File

@ -11,6 +11,8 @@ public:
struct GraphEdge { struct GraphEdge {
ut64 target; ut64 target;
QPolygonF polyline; QPolygonF polyline;
explicit GraphEdge(ut64 target): target(target) {}
}; };
struct GraphBlock { struct GraphBlock {