File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ trait CGenFunctions extends CGenEffect with BaseGenFunctions {
349
349
// Case for functions with a single argument (therefore, not tupled)
350
350
override def emitNode (sym : Sym [Any ], rhs : Def [Any ]) = rhs match {
351
351
case e@ Lambda (fun, x, y) =>
352
- stream.println(" auto " + quote(sym)+ " = [&](" + remap(x.tp)+ " " + quote(x)+ " ) {" )
352
+ stream.println(" auto " + quote(sym)+ " = [&](" + remap(x.tp)+ " & " + quote(x)+ " ) {" )
353
353
emitBlock(y)
354
354
val z = getBlockResult(y)
355
355
if (remap(z.tp) != " void" )
@@ -374,7 +374,7 @@ trait CGenTupledFunctions extends CGenFunctions with GenericGenUnboxedTupleAcces
374
374
375
375
override def emitNode (sym : Sym [Any ], rhs : Def [Any ]) = rhs match {
376
376
case Lambda (fun, UnboxedTuple (xs), y) =>
377
- stream.println(" auto " + quote(sym)+ " = [&](" + xs.map(s=> remap(s.tp)+ " " + quote(s)).mkString(" ," )+ " ) {" )
377
+ stream.println(" auto " + quote(sym)+ " = [&](" + xs.map(s=> remap(s.tp)+ " & " + quote(s)).mkString(" ," )+ " ) {" )
378
378
emitBlock(y)
379
379
val z = getBlockResult(y)
380
380
if (remap(z.tp) != " void" )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ int32_t main(int32_t);
8
8
#include <string.h>
9
9
#include <stdbool.h>
10
10
int32_t main(int32_t x0) {
11
- auto x1 = [&](int32_t x2,int32_t x3) {
11
+ auto x1 = [&](int32_t& x2,int32_t& x3) {
12
12
int32_t x4 = x2;
13
13
bool x6 = x4 == 0;
14
14
int32_t x12;
You can’t perform that action at this time.
0 commit comments