typedef struct _Foo Foo;
typedef struct _FooClass FooClass;
typedef struct _FooPrivate FooPrivate;
-#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ParamSpecFoo ParamSpecFoo;
#define TYPE_BAR (bar_get_type ())
{
self->other_variable = 1;
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&self->priv->__lock_thing_to_lock_on);
{
self->other_variable = 1;
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&BAR_GET_CLASS_PRIVATE (BAR_GET_CLASS (self))->__lock_thing_to_lock_on);
typedef struct _FooClass FooClass;
typedef struct _FooPrivate FooPrivate;
typedef struct _FooClassPrivate FooClassPrivate;
-#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ParamSpecFoo ParamSpecFoo;
struct _Foo {
g_rec_mutex_lock (&self->priv->__lock_faz);
{
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&self->priv->__lock_faz);
g_rec_mutex_lock (&FOO_GET_CLASS_PRIVATE (FOO_GET_CLASS (self))->__lock_baz);
{
}
- goto __finally1;
- __catch1_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp1_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp1_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp1_;
- _g_error_free0 (_lock_error_);
- goto __finally1;
- }
__finally1:
{
g_rec_mutex_unlock (&FOO_GET_CLASS_PRIVATE (FOO_GET_CLASS (self))->__lock_baz);
g_rec_mutex_lock (&__lock_foo_maz);
{
}
- goto __finally2;
- __catch2_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp2_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp2_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp2_;
- _g_error_free0 (_lock_error_);
- goto __finally2;
- }
__finally2:
{
g_rec_mutex_unlock (&__lock_foo_maz);
g_rec_mutex_lock (&self->priv->__lock_foor);
{
}
- goto __finally3;
- __catch3_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp3_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp3_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp3_;
- _g_error_free0 (_lock_error_);
- goto __finally3;
- }
__finally3:
{
g_rec_mutex_unlock (&self->priv->__lock_foor);
g_rec_mutex_lock (&FOO_GET_CLASS_PRIVATE (FOO_GET_CLASS (self))->__lock_boor);
{
}
- goto __finally4;
- __catch4_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp4_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp4_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp4_;
- _g_error_free0 (_lock_error_);
- goto __finally4;
- }
__finally4:
{
g_rec_mutex_unlock (&FOO_GET_CLASS_PRIVATE (FOO_GET_CLASS (self))->__lock_boor);
g_rec_mutex_lock (&__lock_foo_foo_moor);
{
}
- goto __finally5;
- __catch5_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp5_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp5_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp5_;
- _g_error_free0 (_lock_error_);
- goto __finally5;
- }
__finally5:
{
g_rec_mutex_unlock (&__lock_foo_foo_moor);
}
}
{
- gint _tmp6_;
- _tmp6_ = self->priv->_foop;
+ gint _tmp0_;
+ _tmp0_ = self->priv->_foop;
g_rec_mutex_lock (&self->priv->__lock_foop);
{
}
- goto __finally6;
- __catch6_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp7_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp7_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp7_;
- _g_error_free0 (_lock_error_);
- goto __finally6;
- }
__finally6:
{
- gint _tmp8_;
- _tmp8_ = self->priv->_foop;
+ gint _tmp1_;
+ _tmp1_ = self->priv->_foop;
g_rec_mutex_unlock (&self->priv->__lock_foop);
}
if (G_UNLIKELY (_inner_error0_ != NULL)) {
typedef struct _FazClass FazClass;
typedef struct _FazPrivate FazPrivate;
typedef struct _FazClassPrivate FazClassPrivate;
-#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define TYPE_BAR (bar_get_type ())
#define BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BAR, Bar))
faz_private_static_field = 1147;
_vala_assert (faz_private_static_field == 1147, "private_static_field == 1147");
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&__lock_faz_faz_private_static_field);
faz_public_static_field = 1147;
_vala_assert (faz_public_static_field == 1147, "public_static_field == 1147");
}
- goto __finally1;
- __catch1_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp1_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp1_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp1_;
- _g_error_free0 (_lock_error_);
- goto __finally1;
- }
__finally1:
{
g_rec_mutex_unlock (&__lock_faz_faz_public_static_field);
self->priv->private_field = 1147;
_vala_assert (self->priv->private_field == 1147, "private_field == 1147");
}
- goto __finally2;
- __catch2_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp2_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp2_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp2_;
- _g_error_free0 (_lock_error_);
- goto __finally2;
- }
__finally2:
{
g_rec_mutex_unlock (&self->priv->__lock_private_field);
self->public_field = 1147;
_vala_assert (self->public_field == 1147, "public_field == 1147");
}
- goto __finally3;
- __catch3_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp3_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp3_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp3_;
- _g_error_free0 (_lock_error_);
- goto __finally3;
- }
__finally3:
{
g_rec_mutex_unlock (&self->priv->__lock_public_field);
FAZ_GET_CLASS_PRIVATE (FAZ_GET_CLASS (self))->private_class_field = 1147;
_vala_assert (FAZ_GET_CLASS_PRIVATE (FAZ_GET_CLASS (self))->private_class_field == 1147, "private_class_field == 1147");
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&FAZ_GET_CLASS_PRIVATE (FAZ_GET_CLASS (self))->__lock_private_class_field);
FAZ_GET_CLASS (self)->public_class_field = 1147;
_vala_assert (FAZ_GET_CLASS (self)->public_class_field == 1147, "public_class_field == 1147");
}
- goto __finally1;
- __catch1_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp1_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp1_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp1_;
- _g_error_free0 (_lock_error_);
- goto __finally1;
- }
__finally1:
{
g_rec_mutex_unlock (&FAZ_GET_CLASS_PRIVATE (FAZ_GET_CLASS (self))->__lock_public_class_field);
baz_private_static_field = 1147;
_vala_assert (baz_private_static_field == 1147, "private_static_field == 1147");
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&__lock_baz_baz_private_static_field);
baz_public_static_field = 1147;
_vala_assert (baz_public_static_field == 1147, "public_static_field == 1147");
}
- goto __finally1;
- __catch1_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp1_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp1_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp1_;
- _g_error_free0 (_lock_error_);
- goto __finally1;
- }
__finally1:
{
g_rec_mutex_unlock (&__lock_baz_baz_public_static_field);
self->priv->private_field = 1147;
_vala_assert (self->priv->private_field == 1147, "private_field == 1147");
}
- goto __finally2;
- __catch2_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp2_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp2_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp2_;
- _g_error_free0 (_lock_error_);
- goto __finally2;
- }
__finally2:
{
g_rec_mutex_unlock (&self->priv->__lock_private_field);
self->public_field = 1147;
_vala_assert (self->public_field == 1147, "public_field == 1147");
}
- goto __finally3;
- __catch3_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp3_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp3_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp3_;
- _g_error_free0 (_lock_error_);
- goto __finally3;
- }
__finally3:
{
g_rec_mutex_unlock (&self->priv->__lock_public_field);
BAZ_GET_CLASS_PRIVATE (BAZ_GET_CLASS (self))->private_class_field = 1147;
_vala_assert (BAZ_GET_CLASS_PRIVATE (BAZ_GET_CLASS (self))->private_class_field == 1147, "private_class_field == 1147");
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&BAZ_GET_CLASS_PRIVATE (BAZ_GET_CLASS (self))->__lock_private_class_field);
BAZ_GET_CLASS (self)->public_class_field = 1147;
_vala_assert (BAZ_GET_CLASS (self)->public_class_field == 1147, "public_class_field == 1147");
}
- goto __finally1;
- __catch1_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp1_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp1_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp1_;
- _g_error_free0 (_lock_error_);
- goto __finally1;
- }
__finally1:
{
g_rec_mutex_unlock (&BAZ_GET_CLASS_PRIVATE (BAZ_GET_CLASS (self))->__lock_public_class_field);
};
static GParamSpec* sample_properties[SAMPLE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
-#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define MAMAN_TYPE_IBAZ (maman_ibaz_get_type ())
#define MAMAN_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_IBAZ, MamanIbaz))
{
sample_set_public_prop (self, 42);
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp11_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp11_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp11_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
- gint _tmp12_;
- _tmp12_ = self->priv->_public_prop;
+ gint _tmp11_;
+ _tmp11_ = self->priv->_public_prop;
g_rec_mutex_unlock (&self->priv->__lock_public_prop);
}
if (G_UNLIKELY (_inner_error0_ != NULL)) {
}
}
{
- gint _tmp13_;
- _tmp13_ = self->priv->_private_prop;
+ gint _tmp12_;
+ _tmp12_ = self->priv->_private_prop;
g_rec_mutex_lock (&self->priv->__lock_private_prop);
{
sample_set_private_prop (self, 42);
}
- goto __finally1;
- __catch1_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp14_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp14_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp14_;
- _g_error_free0 (_lock_error_);
- goto __finally1;
- }
__finally1:
{
- gint _tmp15_;
- _tmp15_ = self->priv->_private_prop;
+ gint _tmp13_;
+ _tmp13_ = self->priv->_private_prop;
g_rec_mutex_unlock (&self->priv->__lock_private_prop);
}
if (G_UNLIKELY (_inner_error0_ != NULL)) {
typedef struct _Foo Foo;
typedef struct _FooClass FooClass;
typedef struct _FooPrivate FooPrivate;
-#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ParamSpecFoo ParamSpecFoo;
struct _Foo {
g_rec_mutex_lock (&self->priv->__lock_lockable);
{
}
- goto __finally0;
- __catch0_g_error:
- {
- GError* _lock_error_ = NULL;
- GError* _tmp0_;
- _lock_error_ = _inner_error0_;
- _inner_error0_ = NULL;
- _tmp0_ = _lock_error_;
- _lock_error_ = NULL;
- _inner_error0_ = _tmp0_;
- _g_error_free0 (_lock_error_);
- goto __finally0;
- }
__finally0:
{
g_rec_mutex_unlock (&self->priv->__lock_lockable);
public override bool check (CodeContext context) {
if (body != null) {
- // if the statement isn't empty, it is converted into a try statement
+ if (!body.check (context)) {
+ return false;
+ }
+ // if the statement isn't empty, it is converted into a try statement
var fin_body = new Block (source_reference);
fin_body.add_statement (new UnlockStatement (resource, source_reference));
- var catch_body = new Block (source_reference);
- catch_body.add_statement (new ThrowStatement (new ReferenceTransferExpression (new MemberAccess.simple ("_lock_error_")), source_reference));
- var catch_clause = new CatchClause (new ErrorType (null, null), "_lock_error_", catch_body, source_reference);
- catch_clause.error_type.value_owned = true;
-
var try_stmt = new TryStatement (body, fin_body, source_reference);
- try_stmt.add_catch_clause (catch_clause);
+ if (body.tree_can_fail) {
+ var catch_body = new Block (source_reference);
+ catch_body.add_statement (new ThrowStatement (new ReferenceTransferExpression (new MemberAccess.simple ("_lock_error_")), source_reference));
+ var catch_clause = new CatchClause (new ErrorType (null, null), "_lock_error_", catch_body, source_reference);
+ catch_clause.error_type.value_owned = true;
+ try_stmt.add_catch_clause (catch_clause);
+ }
var block = new Block (source_reference);
block.add_statement (new LockStatement (resource, null, source_reference));