}
}
- bool is_in_constructor () {
+ public bool is_in_constructor () {
var sym = current_symbol;
while (sym != null) {
if (sym is Constructor) {
return false;
}
- bool is_in_destructor () {
+ public bool is_in_destructor () {
var sym = current_symbol;
while (sym != null) {
if (sym is Destructor) {
ccode.add_expression (ccritical);
ccode.add_expression (cclear);
- if (current_method is CreationMethod) {
+ if (is_in_constructor () || is_in_destructor ()) {
+ // just print critical, do not return prematurely
+ } else if (current_method is CreationMethod) {
if (current_method.parent_symbol is Struct) {
ccode.add_return ();
} else {