summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2017-06-12 18:12:30 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:25:42 -0300
commit94c375238b89f45b432f107b6d511863c5614712 (patch)
tree4ba3c05e64af2b2884bc06b332c20d9c0ad15113
parentedce90351fb581d186eb2a92f6aa41201eec4b77 (diff)
eolian_mono: Assign a default value to out vars
This is a preparation to the try/catch in the native wrapper in the next commits.
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index 53b6b8afb2..e834401709 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -625,6 +625,13 @@ struct native_convert_out_variable_generator
625 type << " " << string << ";\n" 625 type << " " << string << ";\n"
626 ).generate(sink, std::make_tuple(param.type, out_variable_name(param.param_name)), context); 626 ).generate(sink, std::make_tuple(param.type, out_variable_name(param.param_name)), context);
627 } 627 }
628 else if (param.direction == attributes::parameter_direction::out)
629 {
630 // Assign a default value to the out variable in case we end up in the catch clause.
631 return as_generator(
632 string << " = default(" << type << ");"
633 ).generate(sink, std::make_tuple(param.param_name, param), context);
634 }
628 return true; 635 return true;
629 } 636 }
630 637