From 2143caf36b35ee1c0a92cf29d8454725b418601b Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 11 Jan 2017 15:38:28 +0100 Subject: [PATCH] fix a bug detected by mac (leading to segfault) but not others --- src/surf/cpu_interface.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 3d7be6fc91..e9fb0c74f3 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -241,8 +241,14 @@ std::list CpuAction::cpus() { lmm_system_t sys = getModel()->getMaxminSystem(); int llen = lmm_get_number_of_cnst_from_var(sys, getVariable()); - for(int i = 0; i(lmm_constraint_id(lmm_get_cnst_from_var(sys, getVariable(), i))); + Cpu* cpu = dynamic_cast(resource); + if (cpu != nullptr) + retlist.push_back(cpu); + } return retlist; } -- 2.20.1