RefPtr<FunctionCall> call = new FunctionCall;
call->name = type.name;
call->constructor = true;
- call->arguments.push_back(0);
- call->arguments.back() = expr;
+ call->arguments.push_back_nocopy(expr);
call->type = &type;
expr = call;
}
{
BasicTypeDeclaration *basic_true = dynamic_cast<BasicTypeDeclaration *>(ternary.true_expr->type);
BasicTypeDeclaration *basic_false = dynamic_cast<BasicTypeDeclaration *>(ternary.false_expr->type);
+ if(!basic_true || !basic_false)
+ return;
+
Compatibility compat = get_compatibility(*basic_true, *basic_false);
if(compat==NOT_COMPATIBLE)
return;
stage inline it if that's reasonable. */
RefPtr<VariableDeclaration> temporary = new VariableDeclaration;
temporary->type = args.front().type->name;
- temporary->name = get_unused_variable_name(*current_block, "_temp", string());
+ temporary->name = get_unused_variable_name(*current_block, "_temp");
temporary->init_expression = call.arguments.front();
current_block->body.insert(insert_point, temporary);