Commit fd228588 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Fix crash when using invalid throw expressions, fixes bug 565571

2009-01-04  Jürg Billeter  <j@bitron.ch>

	* vala/valathrowstatement.vala:

	Fix crash when using invalid throw expressions, fixes bug 565571

svn path=/trunk/; revision=2275
parent ffb6fbb2
2009-01-04 Jürg Billeter <j@bitron.ch>
* vala/valathrowstatement.vala:
Fix crash when using invalid throw expressions, fixes bug 565571
2009-01-04 Jürg Billeter <j@bitron.ch> 2009-01-04 Jürg Billeter <j@bitron.ch>
* vapi/packages/gtk+-2.0/: * vapi/packages/gtk+-2.0/:
......
/* valathrowstatement.vala /* valathrowstatement.vala
* *
* Copyright (C) 2007-2008 Jürg Billeter * Copyright (C) 2007-2009 Jürg Billeter
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -84,7 +84,10 @@ public class Vala.ThrowStatement : CodeNode, Statement { ...@@ -84,7 +84,10 @@ public class Vala.ThrowStatement : CodeNode, Statement {
error_expression.target_type.value_owned = true; error_expression.target_type.value_owned = true;
if (error_expression != null) { if (error_expression != null) {
error_expression.check (analyzer); if (!error_expression.check (analyzer)) {
error = true;
return false;
}
if (!(error_expression.value_type is ErrorType)) { if (!(error_expression.value_type is ErrorType)) {
Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ())); Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment