From 812a3e4cd5bafd9127765b648038a104b6ecd7be Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Fri, 25 Oct 2024 14:18:27 +0200 Subject: [PATCH] [hlc] prevent recursive template/code copy --- other/haxelib/Run.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/other/haxelib/Run.hx b/other/haxelib/Run.hx index 40a695f50..6f0fe346f 100644 --- a/other/haxelib/Run.hx +++ b/other/haxelib/Run.hx @@ -67,7 +67,10 @@ class Build { if( !sys.FileSystem.exists(srcDir) ) throw "Failed to find make template '"+tpl+"'"; } - + if( StringTools.contains(sys.FileSystem.absolutePath(targetDir), sys.FileSystem.absolutePath(srcDir)) ) { + throw "Template "+tpl+" contains "+targetDir+", can cause recursive generation"; + } + var allFiles = config.files.copy(); for( f in config.files ) if( StringTools.endsWith(f,".c") ) {