aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-09-15 17:44:22 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-09-15 17:44:22 +0200
commitfc2655fb3082182075b288b58c93ac563ef661a0 (patch)
treecbc423f1f72886520c3332a55320578a49eb12e1 /gcc/fortran/arith.c
parentfd2805e11b7018a148a4f87201b4d85344b5aad4 (diff)
downloadgcc-fc2655fb3082182075b288b58c93ac563ef661a0.zip
gcc-fc2655fb3082182075b288b58c93ac563ef661a0.tar.gz
gcc-fc2655fb3082182075b288b58c93ac563ef661a0.tar.bz2
arith.c (arith_power): Call gfc_free_expr in case of error.
2012-09-15 Tobias Burnus <burnus@net-b.de> * arith.c (arith_power): Call gfc_free_expr in case of error. * array.c (gfc_match_array_constructor): Initialize variable. (gfc_resolve_character_array_constructor): Remove superfluous check. (gfc_array_dimen_size): Add assert. * check.c (numeric_check): Fix implicit typing. * class.c (gfc_build_class_symbol): Add assert. (finalize_component): Free memory. * dump-parse-tree.c (show_namespace): Add assert. * trans-io.c (transfer_namelist_element, transfer_expr): Avoid memory leakage. (gfc_trans_transfer): Add assert. * trans.c (gfc_trans_runtime_check): Call va_end From-SVN: r191344
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 6fa7c70..e94566a 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -906,7 +906,10 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
if (gfc_notify_std (GFC_STD_F2003, "Noninteger "
"exponent in an initialization "
"expression at %L", &op2->where) == FAILURE)
- return ARITH_PROHIBIT;
+ {
+ gfc_free_expr (result);
+ return ARITH_PROHIBIT;
+ }
}
if (mpfr_cmp_si (op1->value.real, 0) < 0)
@@ -928,7 +931,10 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
if (gfc_notify_std (GFC_STD_F2003, "Noninteger "
"exponent in an initialization "
"expression at %L", &op2->where) == FAILURE)
- return ARITH_PROHIBIT;
+ {
+ gfc_free_expr (result);
+ return ARITH_PROHIBIT;
+ }
}
mpc_pow (result->value.complex, op1->value.complex,