comparison dmd/ReturnStatement.d @ 73:ef02e2e203c2

Updating to dmd2.033
author korDen
date Sat, 28 Aug 2010 19:42:41 +0400
parents 2e2a5c3f943a
children 43073c7c7769
comparison
equal deleted inserted replaced
72:2e2a5c3f943a 73:ef02e2e203c2
328 return new CompoundStatement(loc, s, gs); 328 return new CompoundStatement(loc, s, gs);
329 } 329 }
330 return gs; 330 return gs;
331 } 331 }
332 332
333 if (exp && tbret.ty == TY.Tvoid && !fd.isMain()) 333 if (exp && tbret.ty == Tvoid && !implicit0)
334 { 334 {
335 /* Replace: 335 /* Replace:
336 * return exp; 336 * return exp;
337 * with: 337 * with:
338 * exp; return; 338 * exp; return;
339 * or, if main():
340 * exp; return 0;
339 */ 341 */
340 Statement s = new ExpStatement(loc, exp); 342 Statement s = new ExpStatement(loc, exp);
343 //s = s.semantic(sc);
341 loc = Loc(0); 344 loc = Loc(0);
342 exp = null; 345 if (fd.isMain())
346 exp = new IntegerExp(0);
347 else
348 exp = null;
343 return new CompoundStatement(loc, s, this); 349 return new CompoundStatement(loc, s, this);
344 } 350 }
345 351
346 return this; 352 return this;
347 } 353 }