Changeset 7641b6c
- Timestamp:
- Dec 18, 2017, 2:14:26 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- b8b075cd
- Parents:
- 9058414
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/InitTweak/FixInit.cc ¶
r9058414 r7641b6c 382 382 } // if 383 383 delete stmt; 384 if ( TupleAssignExpr * assign = dynamic_cast< TupleAssignExpr * >( resolved ) ) { 385 // fix newly generated StmtExpr 386 postvisit( assign->stmtExpr ); 387 } 384 388 return resolved; 385 389 } … … 479 483 env->apply( result ); 480 484 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr ); 481 ret-> get_type()->set_const( false );482 stmtExpr-> get_returnDecls().push_front( ret );485 ret->type->set_const( false ); 486 stmtExpr->returnDecls.push_front( ret ); 483 487 484 488 // must have a non-empty body, otherwise it wouldn't have a result 485 CompoundStmt * body = stmtExpr-> get_statements();489 CompoundStmt * body = stmtExpr->statements; 486 490 assert( ! body->get_kids().empty() ); 487 491 // must be an ExprStmt, otherwise it wouldn't have a result 488 492 ExprStmt * last = strict_dynamic_cast< ExprStmt * >( body->get_kids().back() ); 489 last-> set_expr( makeCtorDtor( "?{}", ret, last->get_expr()) );490 491 stmtExpr-> get_dtors().push_front( makeCtorDtor( "^?{}", ret ) );493 last->expr = makeCtorDtor( "?{}", ret, last->get_expr() ); 494 495 stmtExpr->dtors.push_front( makeCtorDtor( "^?{}", ret ) ); 492 496 } // if 493 497 } … … 606 610 // must have a non-empty body, otherwise it wouldn't have a result 607 611 assert( ! stmts.empty() ); 608 assert ( ! stmtExpr->get_returnDecls().empty() );612 assertf( ! stmtExpr->get_returnDecls().empty(), "StmtExpr returns non-void, but no return decls: %s", toString( stmtExpr ).c_str() ); 609 613 stmts.push_back( new ExprStmt( new VariableExpr( stmtExpr->get_returnDecls().front() ) ) ); 610 614 stmtExpr->get_returnDecls().clear();
Note: See TracChangeset
for help on using the changeset viewer.