Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 304f353

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Fixes for crashes in dynamic FMUs
Belonging to [master]: - #3028
1 parent ed7a206 commit 304f353

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Compiler/Script/CevalScriptBackend.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3384,7 +3384,7 @@ algorithm
33843384
makefileStr := System.stringReplace(makefileStr, "@NEED_RUNTIME@", "");
33853385
makefileStr := System.stringReplace(makefileStr, "@NEED_DGESV@", "");
33863386
makefileStr := System.stringReplace(makefileStr, "@FMIPLATFORM@", System.modelicaPlatform());
3387-
makefileStr := System.stringReplace(makefileStr, "@CPPFLAGS@", "-I" + includeDefaultFmi);
3387+
makefileStr := System.stringReplace(makefileStr, "@CPPFLAGS@", "-I" + includeDefaultFmi + " -DOMC_SIM_SETTINGS_CMDLINE -DOMC_FMI_RUNTIME=1");
33883388
makefileStr := System.stringReplace(makefileStr, "@LIBTYPE_DYNAMIC@", "1");
33893389
makefileStr := System.stringReplace(makefileStr, "@BSTATIC@", Autoconf.bstatic);
33903390
makefileStr := System.stringReplace(makefileStr, "@BDYNAMIC@", Autoconf.bdynamic);

SimulationRuntime/c/gc/memory_pool.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ static void* pool_malloc(size_t sz)
122122

123123
static int pool_free_extra_list(void)
124124
{
125-
list *freelist = memory_pools->next;
125+
list *freelist;
126+
if (NULL == memory_pools) {
127+
return 0;
128+
}
129+
freelist = memory_pools->next;
126130
while (freelist) {
127131
list *next = freelist->next;
128132
omc_alloc_interface.free_uncollectable(freelist->memory);

0 commit comments

Comments
 (0)