aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2020-02-28 03:05:39 +0100
committerMarcelina Koƛcielnicka <mwk@0x04.net>2020-02-28 03:48:41 +0100
commitbb754441c8acf70f82c1862a214e74164a403dc1 (patch)
treeefc0e42973d7eb1a6f46adb8c60ed32089db3a52 /gui
parent3e95c57317c8cea5f40a546b8dff9d2b63211611 (diff)
downloadnextpnr-bb754441c8acf70f82c1862a214e74164a403dc1.tar.gz
nextpnr-bb754441c8acf70f82c1862a214e74164a403dc1.tar.bz2
nextpnr-bb754441c8acf70f82c1862a214e74164a403dc1.zip
gui: Fix undefined behavior in TreeModel.
std::sort() requires the comparison function to return false for even comparison. Returning true results in undefined behavior and a potential segfault.
Diffstat (limited to 'gui')
-rw-r--r--gui/treemodel.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gui/treemodel.cc b/gui/treemodel.cc
index 97cc8883..e300c74d 100644
--- a/gui/treemodel.cc
+++ b/gui/treemodel.cc
@@ -135,7 +135,7 @@ void IdStringList::updateElements(Context *ctx, std::vector<IdString> elements)
}
// Same string.
- return true;
+ return false;
});
}