Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
h0nzZik committed Jul 2, 2019
1 parent fb9a75d commit 3dfce78
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions semantics/cpp/language/execution/expr/function-call.k
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,18 @@ module CPP-EXECUTION-EXPR-FUNCTION-CALL
<most-derived-class> MDC </most-derived-class>
...</function-control>)

rule <k> bindParam(X::CId, T::CPPType, V:Val) => declareNonStaticObjectExec(X, T,
ExecName(NoNNS(), X) :=init V,
Var(CopyInit()), AutoStorage, .Set) ...</k>
syntax SymBase ::= getBaseOfVal(Val) [function]

rule getBaseOfVal(lv(...v: L::SymLoc) #Or xv(...v: L::SymLoc) #Or prv(...v: L::SymLoc))
=> baseOfLoc(L)

syntax SymBase ::= baseOfLoc(SymLoc) [function]

rule baseOfLoc(loc(Base::SymBase, _)) => Base

rule <k> bindParam(X::CId, T::CPPType, V:Val)
=> addToExecEnv(X, T, getBaseOfVal(V), false)
...</k>
<curr-function-params>... .List => ListItem(X) </curr-function-params>
requires notBool isCPPRefType(T)
andBool X =/=K #NoName
Expand Down

0 comments on commit 3dfce78

Please sign in to comment.