qucs: Fix simulator crash
Avoid undefined behaviour while traversing and modifying a std::list. Patch has been reported to Qucs upstream. Fixes https://github.com/voidlinux/void-packages/issues/7604
This commit is contained in:
parent
4accc03105
commit
bcd147c5e1
|
@ -0,0 +1,17 @@
|
||||||
|
--- qucs-core/src/net.cpp.org 2017-09-13 20:47:24.863069583 +0200
|
||||||
|
+++ qucs-core/src/net.cpp 2017-09-10 00:16:48.863636748 +0200
|
||||||
|
@@ -350,7 +350,13 @@
|
||||||
|
void net::sortChildAnalyses (analysis * parent) {
|
||||||
|
ptrlist<analysis> * alist = parent->getAnalysis ();
|
||||||
|
if (alist != nullptr) {
|
||||||
|
- for (auto *a: *alist) {
|
||||||
|
+
|
||||||
|
+ for (auto it = alist->begin(); it != alist->end(); /* empty */) {
|
||||||
|
+ // Copy the value of the element (a pointer), and advance the
|
||||||
|
+ // iterator prior to manipulating the list.
|
||||||
|
+ analysis *a = *it;
|
||||||
|
+ ++it;
|
||||||
|
+
|
||||||
|
if (a->getType () == ANALYSIS_DC
|
||||||
|
|| containsAnalysis (a, ANALYSIS_DC)) {
|
||||||
|
parent->delAnalysis (a);
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'qucs'
|
# Template file for 'qucs'
|
||||||
pkgname=qucs
|
pkgname=qucs
|
||||||
version=0.0.19
|
version=0.0.19
|
||||||
revision=1
|
revision=2
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--disable-doc"
|
configure_args="--disable-doc"
|
||||||
hostmakedepends="ADMS-qucs gperf qt-devel"
|
hostmakedepends="ADMS-qucs gperf qt-devel"
|
||||||
|
|
Loading…
Reference in New Issue