[vala] Fix crash when compiling empty .vala file



commit ae3cddfb425a618b0d948f0fd39484efb2401544
Author: Rémy Saissy <remy saissy gmail com>
Date:   Sun May 23 12:44:16 2010 +0200

    Fix crash when compiling empty .vala file
    
    Fixes bug 619422.

 vala/valascanner.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/vala/valascanner.vala b/vala/valascanner.vala
index 420530c..8099037 100644
--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -1469,7 +1469,8 @@ public class Vala.Scanner {
 	}
 
 	bool comment (bool file_comment = false) {
-		if (current > end - 2
+		if (current == null
+		    || current > end - 2
 		    || current[0] != '/'
 		    || (current[1] != '/' && current[1] != '*')) {
 			return false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]