Changeset 996337bf in OpenModelica


Ignore:
Timestamp:
2024-04-30T14:24:33+02:00 (3 weeks ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
337cd072, aa44a2d, b54ace2b
Parents:
6c4e231
git-author:
Per Östlund <per.ostlund@…> (04/30/24 14:24:33)
git-committer:
GitHub <noreply@…> (04/30/24 14:24:33)
Message:

Fix creation of binding equations from start values (#12354)

  • Unpropagate the binding when copying it from the start attribute to the component.
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/NFFrontEnd/NFBinding.mo

    ra024851 r996337bf  
    789789  end propagate;
    790790
     791  function unpropagate
     792    input output Binding binding;
     793    input InstNode node;
     794  algorithm
     795    () := match binding
     796      case RAW_BINDING()
     797        algorithm
     798          binding.subs := list(s for s guard not Subscript.isSplitFromOrigin(s, node) in binding.subs);
     799        then
     800          ();
     801
     802      else ();
     803    end match;
     804  end unpropagate;
     805
    791806  function source
    792807    input Binding binding;
  • OMCompiler/Compiler/NFFrontEnd/NFInst.mo

    ra024851 r996337bf  
    22752275    end if;
    22762276
     2277    binding := Binding.unpropagate(binding, node);
    22772278    comp := Component.setBinding(binding, comp);
    22782279    InstNode.updateComponent(comp, node);
  • OMCompiler/Compiler/NFFrontEnd/NFSubscript.mo

    ra024851 r996337bf  
    12751275  end isSplitClassProxy;
    12761276
     1277  function isSplitFromOrigin
     1278    input Subscript sub;
     1279    input InstNode origin;
     1280    output Boolean res;
     1281  algorithm
     1282    res := match sub
     1283      case SPLIT_PROXY() then InstNode.refEqual(origin, sub.origin);
     1284      else false;
     1285    end match;
     1286  end isSplitFromOrigin;
     1287
    12771288  function expandSplitIndices
    12781289    input list<Subscript> subs;
  • testsuite/flattening/modelica/scodeinst/Makefile

    ra024851 r996337bf  
    11551155UnboundParameter2.mo \
    11561156UnboundParameter3.mo \
     1157UnboundParameter4.mo \
    11571158usertype1.mo \
    11581159usertype2.mo \
Note: See TracChangeset for help on using the changeset viewer.