diff core/src/luan/impl/LuanCompiler.java @ 457:0ca5d1d6250b

handle StackOverflowError for circular references
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 05 May 2015 23:10:34 -0600
parents 23b99a5039b5
children 30544d1a9cbf
line wrap: on
line diff
--- a/core/src/luan/impl/LuanCompiler.java	Tue May 05 22:58:23 2015 -0600
+++ b/core/src/luan/impl/LuanCompiler.java	Tue May 05 23:10:34 2015 -0600
@@ -38,6 +38,9 @@
 //e.printStackTrace();
 			LuanElement le = new LuanSource.CompilerElement(parser.source);
 			throw luan.bit(le).exception( e.getFancyMessage() );
+		} catch(StackOverflowError e) {
+			LuanElement le = new LuanSource.CompilerElement(parser.source);
+			throw luan.bit(le).exception("stack overflow");
 		}
 	}