From: Juerg Billeter Date: Wed, 16 Apr 2008 16:24:46 +0000 (+0000) Subject: improve error handling, fixes bug 528431 X-Git-Tag: VALA_0_3_1~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e1d4bca0b5b914978432c6bca61e5d448838a63;p=platform%2Fupstream%2Fvala.git improve error handling, fixes bug 528431 2008-04-16 Juerg Billeter * vala/valaparser.vala: improve error handling, fixes bug 528431 svn path=/trunk/; revision=1246 --- diff --git a/ChangeLog b/ChangeLog index 29d9e15..ff26c1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-04-16 Jürg Billeter + * vala/valaparser.vala: improve error handling, fixes bug 528431 + +2008-04-16 Jürg Billeter + * gobject/valaccodegeneratorinvocationexpression.vala: Fix generated C code when calling struct methods diff --git a/vala/valaparser.vala b/vala/valaparser.vala index ce25605..4add7b8 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -468,6 +468,11 @@ public class Vala.Parser : CodeVisitor { found = false; break; } + + if (expr == null) { + // workaround for current limitation of exception handling + throw new ParseError.SYNTAX ("syntax error in primary expression"); + } } return expr; @@ -1074,6 +1079,10 @@ public class Vala.Parser : CodeVisitor { next (); var rhs = parse_expression (); expr = context.create_assignment (expr, rhs, operator, get_src (begin)); + if (expr == null) { + // workaround for current limitation of exception handling + throw new ParseError.SYNTAX ("syntax error in assignment"); + } } else if (current () == TokenType.OP_GT) { // >>= char* first_gt_pos = tokens[index].begin.pos; next (); @@ -1082,6 +1091,10 @@ public class Vala.Parser : CodeVisitor { next (); var rhs = parse_expression (); expr = context.create_assignment (expr, rhs, AssignmentOperator.SHIFT_RIGHT, get_src (begin)); + if (expr == null) { + // workaround for current limitation of exception handling + throw new ParseError.SYNTAX ("syntax error in assignment"); + } } else { prev (); break;