Selaa lähdekoodia

too much big array error msg

Nicolas Cannasse 18 vuotta sitten
vanhempi
commit
e7d8c0fa7d
2 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 1 0
      doc/CHANGES.txt
  2. 1 0
      genneko.ml

+ 1 - 0
doc/CHANGES.txt

@@ -5,6 +5,7 @@
 	fix for JS and Flash9 XML parser : allow newlines in attributes
 	disable Flash9 resources with AS3Gen
 	error on extra anonymous fields
+	error on too much big neko array declaration (neko 1.6 max_stack limit)
 
 2007-07-25: 1.14
 	fixed no error when invalid "catch" expression

+ 1 - 0
genneko.ml

@@ -284,6 +284,7 @@ and gen_expr ctx e =
 	| TObjectDecl fl ->
 		(EObject (List.map (fun (f,e) -> f , gen_expr ctx e) fl),p)
 	| TArrayDecl el ->
+		if List.length el > 115 then error "This array declaration is too big, try to split it" e.epos;
 		call p (field p (ident p "Array") "new1") [array p (List.map (gen_expr ctx) el); int p (List.length el)]
 	| TCall (e,el) ->
 		gen_call ctx p e el