From a3c36dca9f4478fe639206bb17288d9111b6e096 Mon Sep 17 00:00:00 2001 From: Peter Aronsson Date: Wed, 3 Feb 2010 15:22:47 +0000 Subject: [PATCH] -Small bugfix for instantiation of derivative functions. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4910 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/Inst.mo | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Compiler/Inst.mo b/Compiler/Inst.mo index d925dc3f5d4..8310d084749 100644 --- a/Compiler/Inst.mo +++ b/Compiler/Inst.mo @@ -5588,8 +5588,9 @@ algorithm Env.Cache cache; DAE.DAElist dae,dae1,dae2,dae3; - /* implicit inst. */ + /* no more components. */ case (cache,env,ih,_,_,_,_,{},_,_,_,_) then (cache,env,ih,DAEUtil.emptyDae); + /* A TPATH component */ case (cache,env,ih,mod,pre,csets,cistate, (((comp as SCode.COMPONENT(component = n, @@ -9540,8 +9541,10 @@ algorithm (cache,cdef,cenv) = Lookup.lookupClass(cache,env,p,true); (cache,p) = makeFullyQualified(cache,cenv,p); // add to cache before instantiating, to break recursion for recursive definitions. - cache = Env.addCachedInstFunc(cache,p); + cache = Env.addCachedInstFunc(cache,path); + cache = Env.addCachedInstFunc(cache,p); (cache,_,ih,dae1) = implicitFunctionInstantiation(cache,cenv,ih,DAE.NOMOD(),Prefix.NOPRE(), Connect.emptySet,cdef,{}); + dae1 = addNameToDerivativeMapping(dae1,path); dae1 = DAEUtil.addDaeFunction(dae1); (cache,dae2) = instantiateDerivativeFuncs2(cache,env,ih,paths,path);